+ All Categories
Home > Documents > WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet...

WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet...

Date post: 23-Jun-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
259
Transcript
Page 1: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:
Page 2: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 1

Table of Contents

8.1 QUICK TOUR....................................................................................................... 6

8.1.1 AdventNet Bean Builder ............................................................................................. 6 8.1.2. Technology overview................................................................................................. 8

8.1.2.1 Java™ Beans.......................................................................................................................9 8.1.2.2 Remote Method Invocation (RMI)......................................................................................11

8.1.3 AdventNet Bean Builder Experience ........................................................................ 13 8.1.4 Key Features and Benefits ....................................................................................... 15

8.2 GETTING STARTED WITH BEAN BUILDER ................................................... 16

8.2.1 Starting Bean Builder................................................................................................ 16

8.3 EXPLORING BEAN BUILDER WORKSPACE.................................................. 17

8.3.1 Workspace Organization .......................................................................................... 17 8.3.1 Menubar................................................................................................................................18 8.3.1.1 Menubar.............................................................................................................................18

8.3.1.1.1 File Menu ................................................................................................................................... 19 8.3.1.1.2 Edit Menu ................................................................................................................................... 22 8.3.1.1.3 View Menu ................................................................................................................................. 24 8.3.1.1.4 Build Menu ................................................................................................................................. 25 8.3.1.1.5 Project Menu .............................................................................................................................. 28 8.3.1.1.6 Properties Menu......................................................................................................................... 30 8.3.1.1.7 Versioning Menu ........................................................................................................................ 31 8.3.1.1.8 Tools Menu ................................................................................................................................ 32 8.3.1.1.9 Help Menu.................................................................................................................................. 33

8.3.1.2 Toolbar...............................................................................................................................34 8.3.1.3 Beans Palette.....................................................................................................................35 8.3.1.4 Project/Component Tree....................................................................................................36 8.3.1.5 Draw Area ..........................................................................................................................37 8.3.1.6 JMACS Editor ....................................................................................................................38

8.3.2 Using Status Window................................................................................................ 40 8.3.3.1 Customizing Menubar........................................................................................................41 8.3.3.2 Menu File Format...............................................................................................................42

8.3.4 Popup Menus............................................................................................................ 44 8.3.5 Setting Global Properties of Bean Builder IDE ......................................................... 50 8.3.6 Using Context Sensitive Help ................................................................................... 52

Page 3: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 2

8.4 WORKING WITH PROJECTS ........................................................................... 53

8.4.1 Creating a Project ..................................................................................................... 54 8.4.2 Setting Look and Feel Standards ............................................................................. 55 8.4.3 Setting Look and Feel Standards ............................................................................. 57 8.4.4 Compiling and Running Projects .............................................................................. 59

8.5. WORKING WITH SCREENS ............................................................................ 60

8.5.1 Build Type of Screens............................................................................................... 61 8.5.2 Creating screens using Screen Builder .................................................................... 62 8.5.3 Choosing Screen Template ...................................................................................... 63

8.5.3.1 Main Screen Templates.....................................................................................................64 8.5.3.2 Sub Screen Templates ......................................................................................................65

8.5.4 Creating and Deleting Screens................................................................................. 66 8.5.5 Setting Screen Properties......................................................................................... 67 8.5.6 Compiling and Running a Screen ............................................................................. 68

8.6. WORKING WITH FILES ................................................................................... 69

8.6.1 Creating, Modifying and Deleting Files ..................................................................... 70 8.6.2 Compiling and Running Files.................................................................................... 71

8.7. WORKING WITH BEANS................................................................................. 72

8.7.1 Searching for Beans ................................................................................................. 73 8.7.2 Reloading Bean ........................................................................................................ 74 8.7.3 Replacing Bean ....................................................................................................... 75 8.7.4 Adding Beans to Palette ........................................................................................... 77 8.7.5 Using Screens as Beans .......................................................................................... 79 8.7.6 Setting Bean Properties............................................................................................ 81

8.7.6.1 Setting Advanced Properties .............................................................................................84 8.7.6.2 Setting Indexed Properties ................................................................................................86 8.7.6.3 Grouping of Properties.......................................................................................................87

8.7.7 Default Beans in Bean Builder.................................................................................. 89 8.7.7.1 AdventNet ProBeans .........................................................................................................89 8.7.7.2 UI Beans ............................................................................................................................91

8.7.7.2.1 Active Icon.................................................................................................................................. 92 8.7.7.2.2 Dial ............................................................................................................................................. 94 8.7.7.2.3 Digit bean component ................................................................................................................ 95 8.7.7.2.4 Digital Display............................................................................................................................. 96 8.7.7.2.5 HCellular Gauge......................................................................................................................... 97

Page 4: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 3

8.7.7.2.6 Image Button.............................................................................................................................. 99 8.7.7.2.7 Image Label ............................................................................................................................. 101 8.7.7.2.8 Led ........................................................................................................................................... 102 8.7.7.2.9 Led Panel ................................................................................................................................. 104 8.7.7.2.10 Status Icon ............................................................................................................................. 105 8.7.7.2.11 VCellular Gauge..................................................................................................................... 107

8.7.7.3 Util Beans.........................................................................................................................109 8.7.7.3.1 AdventNetPoller ....................................................................................................................... 110 8.7.7.3.2 AdventNet Timer ...................................................................................................................... 111 8.7.7.3.3 Calendar................................................................................................................................... 112 8.7.7.3.4 Card Panel Bean...................................................................................................................... 113 8.7.7.3.5 Color ComboBox...................................................................................................................... 114 8.7.7.3.6 Combiner.................................................................................................................................. 115 8.7.7.3.7 Decimal Spin Control................................................................................................................ 116 8.7.7.3.8 Decimal Text Field.................................................................................................................... 117 8.7.7.3.9 Export Table............................................................................................................................. 118 8.7.7.3.10 JDBC Adapter ........................................................................................................................ 119 8.7.7.3.11 MaxMinThresholdAlerter ........................................................................................................ 120 8.7.7.3.12 Net Address Field................................................................................................................... 121 8.7.7.3.13 Numeric Spin Control ............................................................................................................. 122 8.7.7.3.14 Print Table.............................................................................................................................. 123 8.7.7.3.15 Sort Table............................................................................................................................... 124 8.7.7.3.16 Threshold Alerter.................................................................................................................... 125 8.7.7.3.17 Time bean .............................................................................................................................. 126

8.8. LAYING OUT COMPONENTS........................................................................ 127

8.8.1 Using Null Layout.................................................................................................... 128 8.8.2 Using Flow Layout .................................................................................................. 130 8.8.3 Using Border Layout ............................................................................................... 132

8.8.4 Using Grid Layout ................................................................................................... 134 8.8.5 Using Gridbag Layout ............................................................................................. 136 8.8.6 Using Card Layout .................................................................................................. 139

8.9. INTERACTION BETWEEN COMPONENTS .................................................. 140

8.9.1 Editing Interaction between Components ............................................................... 145 8.9.2 Viewing the Interaction ........................................................................................... 147

Page 5: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 4

8.10 ADDING MENU AND TOOL BAR TO APPLICATIONS................................ 149

8.10.1 Adding Menubar ................................................................................................... 149 8.10.2 Adding Toolbar ..................................................................................................... 152 8.10.3 Adding Popup Menus to Components .................................................................. 153

8.11 INTERNATIONALIZING THE APPLICATION ............................................... 155

8.11.1 Internationalizing the Application .......................................................................... 155

8.12 CONFIGURING JAVA SECURITY POLICY.................................................. 159

8.12.1 Using Policy Tool .................................................................................................. 159

8.13. SOURCE GENERATION .............................................................................. 160

8.13.1 Viewing the Generated Source............................................................................ 161 8.13.2 Editing Source Files.............................................................................................. 163

8.13.3 Source Code Flow for different build types........................................................... 170 8.13.4 Customizing Source Generation........................................................................... 172

8.14 UNIT TESTING THE APPLICATIONS........................................................... 175

8.14.1 Testing the Application ......................................................................................... 175

8.15. VERSIONING CONTROL FOR THE PROJECT........................................... 177

8.15.1 Setting CVS Server options .................................................................................. 178 8.15.2 Running CVS Commands..................................................................................... 180

8.15.2.1 Import a Project..............................................................................................................182 8.15.2.2 Add File..........................................................................................................................184 8.15.2.3 Check in .........................................................................................................................185 8.15.2.4 Check out Project ..........................................................................................................186 8.15.2.5 Update File.....................................................................................................................188 8.15.2.6 Viewing differences using Diff command.......................................................................190 8.15.2.7 Viewing Logs..................................................................................................................192 8.15.2.8 View Status ....................................................................................................................193

8.16 PACKAGING AND DEPLOYING APPLICATIONS....................................... 194

8.16.1 Packaging of Jar Components.............................................................................. 194 8.16.2 Packaging for AdventNet Web NMS (NAR).......................................................... 202

8.16.2.1 General Packaging ........................................................................................................204 8.16.2.2 Device Specific Packaging ............................................................................................208

8.17 INTEGRATING TOOLS INTO IDE................................................................. 213

8.17.1 Configuring Tools.................................................................................................. 213

Page 6: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 5

8.18 CONFIGURING SERVERS............................................................................ 215

8.18.1 Features in Servers UI.......................................................................................... 215 8.18.2 Adding a New Server............................................................................................ 217

8.19 MIGRATION GUIDE ...................................................................................... 219

8.19.1 Migrating the project ............................................................................................. 219 8.19.2 Troubleshooting in Migration Wizard .................................................................... 226

8.20. INTRODUCTION TO TUTORIALS ............................................................... 228

8.20.1 Building a Sample Application .............................................................................. 229 8.20.1.1 Step 1: Creating a Project..............................................................................................230 8.20.1.2 Step 2: Creating a Screen .............................................................................................231 8.20.1.3 Step 3: Laying Out the Components .............................................................................233 8.20.1.4 Step 4: Setting Bean Properties ....................................................................................235 8.20.1.5 Step 5: Creating connection between beans.................................................................237 8.20.1.6 Step 6: Compiling and Running the project ...................................................................244

8.21 FREQUENTLY ASKED QUESTIONS ........................................................... 246

8.22 TROUBLESHOOTING IN BEAN BUILDER .................................................. 254

8.23. API DOCUMENTATION ............................................................................... 257

8.24. KNOWN ISSUES .......................................................................................... 258

Page 7: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 6

8.1 Quick Tour

8.1.1 AdventNet Bean Builder

Key Features: Fast Track Development. Separation of Development Focus: Usability vs Business Logic. Easy application development for AdventNet Web NMS. Based on Open Standards.

The AdventNet Bean Builder is a Visual Integrated Development Environment (IDE) based on Java Beans technology, for rapid development of Java Client Applications based on JFC/Swing (Java Foundation Classes), built entirely in Java. It provides developers with a complete development suite to shorten the life-cycle for application development. Equipped with comprehensive Java Bean component gallery, easy to use visual draw area, automatic code generation, sophisticated code editor, Integrated debug and test environment, support for CVS (Concurrent Versioning System) based repository maintenance, and smart application deployment packaging features, Bean Builder has everything needed for rapid development and deployment of pure Java based client applications. Some of the Key features of Bean Builder are: Fast Track Development You do not have to be an expert developer to take advantage of Bean Builder. And you can get started right away. Proven framework and an easy-to-use visual development environment enables you to develop quality and highly usable client applications code the first time out. That is because Bean Builder simplifies the creation and deployment of flexible and usable client applications that leverage reusable Java Bean components services. Auto code generation alleviates the scope of human error in source code generated, thus cuts time and cost on development, debugging and testing. In-built tools for code editing, debugging, testing, maintenance and packaging gets you right away into the Fast Track Application development. Separation of Development Focus: Usability vs Business Logic Comprehensive component gallery, easy to use visual draw area, built-in wizards and automatic compliance to look & feel standards provide the right setup for Usability Engineers to take up designing highly usable client screens. This allows developers to focus on adding the necessary business logic for the applications developed. Easy application development for AdventNet Web NMS Client Being bred from the same farm house of AdventNet products, Bean Builder extends itself seamlessly as an easy development tool to build Client applications for deployment over AdventNet Web NMS, the Management Framework product of AdventNet. Through the proprietary NAR (NMS Archive) packaging mechanism, any client applications can be developed and deployed over Web NMS without any hassles, leveraging the simple-to-use, yet powerful features of Bean Builder.

Page 8: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 7

Based on Open Standards Bean Builder is a pure Java application, built over market proven and open standards like XML, Java Beans, and JFC/Swing. Being a pure Java application, it gives you a considerable flexibility to develop on your platform of choice: Solaris[tm] Operating Environment, Linux, and Microsoft Windows. It provides a complete and compelling solution for developing high-quality, attractive, usable client applications for any OS platform of your choice, leveraging Java's Build once Run anywhere capability. Please click here to view the detailed features and benefits of Bean Builder.

Page 9: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 8

8.1.2. Technology overview

Technology Overview - Introduction The AdventNet Bean Builder integrates and allows developers to leverage many technologies. This page provides some introductory and review material, as well as links to resources on many of these basic technologies. Java and associated technologies are emerging as the preferred way to build client based applications. Chief among the reasons for this growing trend is the ease of use of this new technology, shortening development cycles, etc. The architecture, on which the Bean Builder is built upon, is also dealt with in this section. Java Beans gives a brief introduction to the Java event model and Java Beans. RMI gives a brief introduction to its concepts, architecture and features. The following are the web resource links to some of the other technologies used within or by Bean Builder.

• Java Runtime Environment • JDBC • XML • JFC/Swing • Java Plug-in

Page 10: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 9

8.1.2.1 Java™ Beans Java and associated technologies are emerging as the preferred way to build network management solutions, both for server and client side applications. Chief among the reasons for this growing trend is the ease of use of this new technology, which shortens development cycles. The growth of this industry is also making more and more tools available to network management developers. Building Java based Management Applications Java, being a new and fast evolving technology, has undergone many changes since it was first introduced. One of the significant changes in Version 1.1 was the adoption of a new event model, which also became a cornerstone of the Java Beans component model. The introduction of the Java beans component model is a major change, which enables powerful component based development that promises to increase development productivity. Java Beans throws open a large library of software building blocks. The developers can construct sophisticated applications easily by assembling these building blocks. Java 1.1 Event Model

Object Oriented Programming exposes the view that all systems can be modelled simply with objects and messages, or events, between objects. Java 1.1 events provide an elegant way to model these events between objects, and enables general-purpose techniques, i.e., using Java beans technology, for assembling objects into larger systems with desired functionality. The Java 1.1 event model is designed to be a flexible means of connecting components, and therefore allows registration mechanisms for connecting event sources to event sinks. The event model has the following elements:

• Event Objects: These objects are subclasses of java.util.EventObject, always with a single source that generated the event. An object listening for these events can access the source and other data/methods provided by the event object. This enables very flexible data passing between objects by defining appropriate methods in the Event object.

• Event Sources: These sources generate events, and allow listeners to register for events in a one-to-many relationship. The event sources generate events to all registered listeners whenever the event generation conditions are met, e.g. when polling SNMP data and a response is received.

• Event Listeners: The event listeners receive the events and do the desired operations on the event objects. The listener objects need to implement the corresponding listener interface for the event in order to register for the events of a given type.

A number of standard event types are defined for specific applications, e.g. AWT events like Mouse Motion Event. For any event type, a listener interface is defined. Any object that implements the listener interface can register with an event source that generates such events. This enables flexible interconnections between event sources and event listeners where the details of the sources are not known to the listener objects at design time, and vice versa. For example, we can design a source for SNMP Polling Events that has no knowledge of the actual object that will be connected to it. Taking advantage of the Java 1.1 event model requires a change in the way systems and components are designed. However, with the new, more object-oriented approach to the design of applications, significant benefits in flexibility and code reuse are possible. Java Beans Component-based approaches to building software are now recognized as the best way to deal with the increasing complexity of software systems. While not a revolutionary idea in software design, the

Page 11: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 10

Java bean component approach, to building Java applications, promises to allow building powerful applications with reduced effort from software developers, using standard off-the-shelf components. Developers can take components from a number of sources and assemble them to create new and more powerful applications. Java bean technology is designed to be used in visual builders as well be used in traditional user programs. The key to allowing use of diverse components in visual builders is standardization of design patterns, i.e., patterns for how standard capabilities of components are implemented. This standardization is key to automating the use of these components and minimizing user code. Any Java class can be considered a Java bean. What compels a Java class to be called a Java bean is when it follows the design patterns prescribed by Java Bean technology, and allows builder tools and humans to easily understand and use the bean in development. There are two primary aspects to Java bean technology:

• Bean Properties: This determines the state of a Java bean. Users need easy and understandable ways of setting properties of beans, and the beans design patterns, for getting and setting properties makes this possible.

• Bean Connections using Events: These are the interconnections between Java beans that are best implemented as events between beans. Beans can define and implement events using standard Java beans design patterns, enabling easy interpretation and use of these events in connecting beans.

Page 12: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 11

8.1.2.2 Remote Method Invocation (RMI) RMI applications are often comprised of two separate programs: a server and a client. A typical server application creates some remote objects, makes references to them accessible, and waits for clients to invoke methods on these remote objects. A typical client application gets a remote reference to one or more remote objects in the server and then invokes methods on them. RMI provides the mechanism by which the server and the client communicate and pass information back and forth. Such an application is sometimes referred to as a distributed object application. Distributed object applications need to

• Locate remote objects: Applications can use one of two mechanisms to obtain references to remote objects. An application can register its remote objects with RMI's simple naming facility, the rmiregistry, or the application can pass and return remote object references as part of its normal operation.

• Communicate with remote objects: Details of communication between remote objects are handled by RMI; to the programmer, remote communication looks like a standard Java method invocation.

• Load class bytecodes for objects that are passed around: Because RMI allows a caller to pass objects to remote objects, RMI provides the necessary mechanisms for loading an object's code, as well as for transmitting its data.

RMI Architecture The following illustration depicts an RMI distributed application that uses the registry to obtain a reference to a remote object. The server calls the registry to associate (or bind) a name with a remote object. The client looks up the remote object by its name in the server's registry and then invokes a method on it. The illustration also shows that the RMI system uses an existing Web server to load class bytecodes, from server to client and from client to server, for objects when needed.

Remote Method Invocation (RMI) The goals for supporting distributed objects in the Java programming language are:

• Support seamless remote invocation on objects in different virtual machines. • Support callbacks from servers to applets. • Integrate the distributed object model into the Java programming language in a natural way

while retaining most of the Java programming language's object semantics. • Make differences between the distributed object model and local Java platform's object model

apparent. • Make writing reliable distributed applications as simple as possible.

Page 13: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 12

• Preserve the type-safety provided by the Java platform's runtime environment. • Support various reference semantics for remote objects; for example live (nonpersistent)

references, persistent references, and lazy activation. • Maintain the safe environment of the Java platform provided by security managers and class

loaders. Underlying all these goals is a general requirement that the RMI model be both simple (easy to use) and natural (fits well in the language). For further knowledge please refer http://java.sun.com/docs/books/tutorial/rmi/ or http://java.sun.com/products/jdk/rmi/

Page 14: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 13

8.1.3 AdventNet Bean Builder Experience

AdventNet Bean Builder is an Integrated Development Environment (IDE) tool, which is used for rapid development of UI based applications. You can just have some idea about the look of your application and sit with the IDE, and you will have the desired application built with in no time. Let us see in brief, the process of developing a complete application. When you start developing any application, the first step is to gather the requirements for the application. Once the requirements are gathered, you can start developing. The various steps in the development life-cycle of an application are:

• Designing and Prototyping. • Developing. • Testing and maintaining. • Packaging and Deploying.

Designing and Prototyping Having the requirements in mind you must proceed with the initial design of the application. The desired layout of the screen components, the expected output format and the scope / limitation of the application are to be decided upon. The IDE would help you to select the appropriate layout for the components. Bean builder has a very effective handling for the complex set of layouts provided by java. You can change layouts and fix the right one for your application. After the design is completed, you can start developing the application.

Page 15: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 14

Developing With the initial design in place, you can start the development. Some of the important factors that you must consider while designing any screen are as follows.

• Most of the commonly used screen components are there for you in the form of java beans. You can use these beans to develop your own UI for the application. You can configure these bean properties to suit your need.

• You can write the code to handle the interaction between different beans in the connection wizard. It is very user friendly to handle the communication between beans.

• You can also construct the menus, popup menus and the toolbars using the Screen Menu Configuration UI.

Thus the complete development can be done using the options in the IDE. On completing the screen development, the java source files are generated automatically. Thus your effort on coding is totally eliminated. Later you can check for the proper functioning of the application. Testing and Maintaining Another major step in the application development life-cycle is to check for the desired / targeted functionality in the application. A complete deployment feel / simulation is provided for you to test each and every Screen of type Panel, Dialog, NMSPanel, Frame or NMSFrame as individual Applications or Applets. This helps you to visualize the resultant application, well before the actual / real-time deployment of the application. Now that the application is complete, you may have to maintain it for future reference. You can use the versioning system to save your project files. Bean Builder provides you with an integrated CVS (Concurrent Versioning System), for easy maintenance. The next step is to package and deploy the application in the real-time environment. Packaging Packaging can be done in two ways namely a NAR packaging and a stand-alone packaging. You can package the application for Web NMS by creating a NAR, which can be easily deployed. In this type of packaging you can either do a general or a device specific packaging for Web NMS. You can also create a stand-alone package. Thus the complete development life-cycle is covered in a broad perspective. For further details on how to achieve the various steps above, you can refer to the corresponding sections inside the document.

Page 16: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 15

8.1.4 Key Features and Benefits AdventNet Bean Builder provides a complete Visual Integrated Development Environment (IDE) that enables developers to quickly build high quality, user friendly and easy to deploy, Java based client applications. Bean Builder provides a wide range of features whose benefits could be leveraged for rapid development of high quality Java client applications.

Features Benefits

UI design with reusable Java Beans

Complex screen design is essential for building highly usable UI applications. You can achieve this by just dropping and arranging the reusable java beans in Bean Builder. You can also use a screen created here as a bean, and drop it in other screens.

WYSIWYG Editor The Runtime View support in Builder, helps you to have a feel of how the final application will look like after building it (even at the time of Designing it.) i.e. What You see at Design time is What you get at Run-Time.

Application UI standard setting

Uniform application of UI standards is essential for building consistent and highly usable client applications. This is made possible by Bean Builder through the configuration of UI standards for the applications built. By default it packages the "AdventNet Look and Feel" standard along with it.

Layout Support

A good layout of components in the screen will make the UI highly usable. The complex set of layouts can be configured with ease, using the layout editors in Bean Builder. It is powered with the automatic source generation feature, which totally eliminates your coding effort.

Internationalized Application Development

Building Internationalized applications for user locales across the globe is possible through Bean Builder, using its sophisticated Resource Bundle mechanism. This allows the applications to be built once and shipped / deployed in any number of locales without much change.

Version Control

Bean Builder provides you with an integrated CVS (Concurrent Versioning System), which allows you to perform all the CVS operations, from inside the builder. Thus you can easily maintain the project files, built using the Bean Builder.

Project Packaging for Web NMS

You can easily integrate your project with Web NMS, by following a set of wizard screens. You can either have a Device specific or a General type of NAR file packaged.

Third party bean Integration

Any third party bean can easily be plugged into the Bean Builder palette. You can use these beans along with the default beans.

Screen builder

Design high standard screens using the Screen builder wizard, containing some pre-defined GUI gallery / templates. You can select the type of application with the required components like menubar and toolbar and further customize the application with ease.

Easy Migration

You can easily / smoothly migrate your projects, that are developed using the older version, to the latest version of Bean Builder. After successful migration, you can start developing the projects in the latest version utilizing all the newly available features.

Testing Environment

A complete deployment feel / simulation is provided for you to test each and every Screen of type Panel, Dialog, NMSPanel, Frame or NMSFrame as individual Applications or Applets. This helps you to visualize the resultant application.

Page 17: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 16

8.2 Getting Started with Bean Builder

8.2.1 Starting Bean Builder Bean Builder can be started either through the Web NMS Launcher or directly from the command prompt. Starting Bean Builder from Web NMS Launcher The Web NMS Launcher can be started in various platforms in the following ways.

Note: Please make sure that the JAVA_HOME variable set in the setEnv.bat/sh file is correct. It specifies the directory path where the JDK is installed in your machine.

Windows: You can open the Web NMS Launcher in either of the two ways mentioned below.

• Double-clicking the WebNMSLauncher.bat file under the <Web NMS Home> directory through Windows Explorer

• Typing WebNMSLauncher.bat in the command prompt that has the path as <Web NMS Home>.

Linux & Solaris: You can open the Web NMS Launcher in Linux and Solaris

o Run the script file WebNMSLauncher.sh under <Web NMS Home> directory. For example, if Bean Builder is installed under the <user home> directory, run the script file as given below:

home/AdventNet/WebNMS>sh WebNMSLauncher.sh

To Run Bean Builder from the Web NMS Launcher window, double click on the Bean Builder icon or else select the icon and choose Options --> Run.

Starting Bean Builder from Command line To start Bean Builder from command line, run the batch/script file BeanBuilder.bat/sh (according to the OS) present under <Web NMS Home>/bin/developertools directory.

Page 18: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 17

8.3 Exploring Bean Builder Workspace

8.3.1 Workspace Organization The workspace of the Bean Builder is discussed in this section. You can get the feel of all the components in the Bean Builder screen. It has a menubar with the options that help you to achieve all your requirements with in the tool. It has a toolbar that is double rowed. The menubar and toolbar are derived from a highly configurable project workspace framework, which provides options to plug in menus and toolbar items with ease. There is a beans palette to the right of the toolbar. Each tab in the palette is a jar and the beans in the jar are shown with icons for each of the beans. You can click and drop these beans to build your applications.

The left hand side panel is divided into two parts. The top part shows the projects and the screens in each of the project. The bottom part shows the components used in the selected screen and the connections between the components. The right hand side panel has three tabs namely Screen, Source and Interaction. The Screen tab has the draw area where the beans are dropped. The source tab shows the java source generated by the Builder, where you can write your own source. The Interaction tab shows the connection between the different components. Each of the above component mentioned above is dealt with in detail, in the next few pages.

Page 19: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 18

8.3.1 Menubar

8.3.1.1 Menubar The Menu Bar of AdventNet Bean Builder provides various menus which give access to the functions of the product. The following are the menus that are available in the Bean Builder. You can access the various menus by clicking on the respective links shown below. Menu Bar

• File • Edit • View • Build • Project • Properties • Versioning • Tools • Help

Page 20: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 19

8.3.1.1.1 File Menu File menu is useful for creating, opening, closing, saving or reloading a project and exiting the Application. It is also used to create new screens for the currently working project. You can also create, open, reload, save or print java files and load/unload jars used in the current working project. You can also view and open the recently opened projects. The following are the menu items available in the File menu. The file menu changes simultaneously depending upon the modes of tab chosen. For example, when the project tab is chosen from the project tree the following menu items flashes out, with a set of menu items grayed out.

New Project A new project is created using this menu. Choosing this menu item invokes a dialog box requesting to enter the project name. Project names can be any combination of alphanumeric characters without space. It also requests for the package name (optional) to include in the project. Give a valid package name and click the "OK" button to create a new project . Alternatively the new project can also be created from the "new project" icon from the toolbar menu. New Screen A new screen can be created using this menu item. Choosing this menu item invokes the Screen Builder, which provides all the basic screen templates. On choosing a screen of any one of the build types and providing other information, a new screen is created and a screen node is added to the current working project in the "Project Tree". Read this topic for more information on creating new screen using Screen Builder. The components can then be dropped into this screen area and connections can be made to build the screen. Alternatively you can create new screen using the 'new screen' button in the Toolbar. New File

Page 21: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 20

A new Java source file can be created using this menu. Choosing this menu pops-up a dialog box asking general and interface information. File names can be given in any combination of alphanumeric characters without space. Open Project Existing projects can be opened using this menu. Choosing this menu opens up the file open dialog box, so that users can browse and select a project. The AdventNet Java Bean Builder project files are saved with extensions of .proj. Alternatively the existing projects can be opened from the "open project" icon from the toolbar menu or from the directory tree in the Bean Builder screen. Open File Existing source files can be opened using this menu. Choosing this menu opens up the file open dialog box, so that users can browse and select the file. Alternatively the existing source files can be opened from the directory tree. Save Project The current working project is saved under the Projects directory under Web NMS Home Directory as .proj file. Save Screen Invoking this menu saves the current screen available in the builder area. The bean builder saves the screen by its default name new_screen1, new_screen2 etc., . The user can rename the screen by right clicking the mouse button on the default screen name and choosing the Rename option. Save File Saves the source file. The source file is saved under the default name. Save Project As The project file can be saved under different name. It takes a copy of the selected project and saves it in the location specified by you. Save File As The source file can be saved under different name. It takes a copy of the selected file and saves it in the location specified by you. Reload Project If any changes are made out of Draw Area, for example if the source has been edited, the changes can be reflected by using this option. Reload File This menu is used to reload the file and see the latest source code. This becomes useful when the developer wants to see the latest code after modifying the screen. Open Recent Project The projects that were recently opened in Bean Builder are listed here. The user can view and choose any of the recently used project according to his choice.

Page 22: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 21

Close Project The current project can be closed by using this option. If your project has any unsaved information it invokes a dialog and ask for the screens in the unsaved project which you would like to save. By default all the unsaved screens are checked. Check or uncheck whichever necessary and press OK button. You can use the button "Select None" all to uncheck all the screens which are checked. Click the Cancel button to continue working with project. Print File The selected file can be printed using this option. Load Jar Jar files packaged with standard bean components can be loaded in the Components palette using this menu item. For more information, refer the topic Adding Components to palette. UnLoad Jar The loaded jar files which are available in the Components palette can be unloaded using this option. Invoking this menu pops-up a dialog box which lists all the jars that are loaded. Select the jar and click "Remove" to unload the jar from the Components palette. The unloaded jar can be loaded again using the load jar option. Exit Invoking this menu closes the application. The builder prompts to save any unsaved information before closing the application. Shortcuts

Function Shortcut

Open Project Ctrl-O

Close Project Ctrl+W

New Screen Ctrl-N

Save Screen Ctrl+S

Print File Ctrl+P

Load Jar Ctrl+J

Unload Jar Ctrl+U

Exit Alt+F4

Page 23: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 22

8.3.1.1.2 Edit Menu

The standard system edit commands such as undo, redo, cut, copy and paste are provided in this menu. The operations are performed in the components in the Bean builder area. These commands are available when the screen tab is chosen in the Bean Builder screen area. Undo To Undo the previous action. Alternatively click the 'Undo' icon from the toolbar. Redo To Redo the previous action. Alternatively click the 'Redo' icon from the toolbar. Cut You can cut a bean from its existing place using this option. Alternatively click the 'Cut Beans' icon from the toolbar. Copy You can make a copy of a bean using this option. This option will copy a bean along with its property settings. Alternatively click the 'Copy Beans' icon from the toolbar. Paste You can paste a bean which is already copied or cut, using this option. This will have no effect if nothing is copied or cut. Alternatively click the 'Paste Beans' icon from the toolbar. Delete When a bean is no more needed, it can deleted from the Draw Area using this option. Alternatively click the 'Delete Beans' icon from the toolbar. For information on deleting beans which are connected, refer the topic Editing Component Interactions. Shortcuts

Function Shortcut

Undo Ctrl+Z Redo Ctrl+Y Cut Ctrl+X Copy Ctrl+C Paste Ctrl+V Delete Ctrl+D

Page 24: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 23

Page 25: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 24

8.3.1.1.3 View Menu The following are the menu items under the View Menu.

Tool Bar This menu item lets the user decide if he/she wants the tool-bar to be visible or hidden below the menu bar. If it is checked, then the tool-bar and the bean-box are visible. If it is not checked, then the tool-bar and the bean-box are hidden. Grid This checkbox menu item helps the user to decide if he/she wants to view the screen with grids or not. Floatable This checkbox helps the user make the draw area floatable. It gives you larger display area. Once all the required components are dropped, we can make the draw area floatable and then user can arrange the components with the larger available area. You can also use the Layout Support provided by Bean Builder. Runtime View This gives a view of the screen as it would appear at runtime. Connections and other property setting can be done in RunTime View also. But the only drawback is that it won't take into effect the look and feel.

Note: Once the draw area is made floatable, the user cannot drop components. If you want to drop components please revert back to the original position by disabling the check box in the View Menu

Status Window The Status Window displays the status and error messages obtained due to various actions performed in Bean Builder. For more details, refer topic Using Status Window.

Page 26: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 25

8.3.1.1.4 Build Menu

Build - Type Once the developer finalizes on the components, its properties and connections, the above menus can be used to build the project. The project can be built as an Application, Applet, frame, Panel and so on depending upon the type of menu item chosen in "Type" sub-menu. The default Type is Application. Application Choosing the build type as Application generates the source code for the current screen and runs that particular screen as Application. Console Application The console application can be chosen when the user needs to create a non- UI application. These type of Java files can be used as Interface, which can be implemented in some other applications. To view the structure of the console application that is generated by using the Bean Builder, have a look at the ConsoleApplicationTemplate.java in the Template directory of the AdventNet Bean Builder. Extra methods/variables/headers can be added here if you want. Ensure that you do not remove any of the tags. Applet Choosing the radio button Applet generates the source code for the current screen in the builder area and also the HTML file needed to view the applet. Once the code is successfully compiled without any errors the builder launches the applet viewer to view the applet. Frame Choosing the radio button Frame sets the screen type as Frame, which extends JFrame. You can run it as an Application or Applet depending on the type set in "Project Properties-->Run Setup".

Page 27: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 26

NmsFrame NmsFrame is a class that extends JFrame and implements NmsFrame. It does not have a main method. The purpose of NmsFrame is to enable the integration of the UI with the AdventNet Web NMS. Panel Choosing Panels sets the screen build type as Panel. The Panels are generated as applet or application and can be included in any of the container jars. You can also reuse the panel created as applet or application in another screen. This can be achieved by clicking and dropping the class from the Project Classes tab. NmsPanel The purpose of NmsPanel is to enable the integration of the UI with the AdventNet Web NMS. It is a class that extends JPanel with a inner class extending AbstractNmsPanel. Dialog Invoking the menu Dialog sets the current screen build type as Dialog. It can be invoked from the main screen. Regenerate The Regenerate menu is used to regenerate the source if there are any modifications made in the screen. If some other Custom code is added or some new methods are added in the screen properties, the regenerate option must be used to have the changes in effect. Compile This option compiles the source of the currently selected screen. The status of the compilation will be displayed in the status bar. If the compilation fails error is flashed in the status window. Run This option will run the screen as an application or applet or whatever it is depending on the type set. Compile & Run The Compile and Run menu compiles the source and runs the screen. The status of the compilation is shown in the status bar. If the compilation fails the error is flashed in the status window. If the compilation succeeds then the screen is set to run using applet viewer or as an application depending on the type chosen. Test with Browser The Test with Browser (F9) tests the applet by launching the browser. The applet is launched through the web server that comes along with the AdventNet Bean Builder. The web server is needed to access the applet across the network. If the applet is accessed from the local hard disk then the web server is not needed. If the applet uses swing or JFC components the browser needs Sun's Java plug-in. Applet which do not use swing components can be tested using standard web browsers (Netscape 4.x / IE 4.x). Please note that the JDK 1.1 patch for Netscape 4.x, has to be uninstalled before installing Sun's Java plug-in. Netscape's JDK 1.1 patch conflicts with Java plug-in from Sun.

Page 28: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 27

Recreate If you add code or make changes to the Source in the Source View (after dropping the required beans and setting connections in the Screen View), the "Recreate" menu item enables you to get back the original source generated for whatever done in the Screen View. Take the case when the custom code is merged with the generated source and contains wrong format. This will result in parsing error and a series of dialogs popup to inform the parsing error. When the user unknowingly chooses the wrong options, the source will be regenerated a new with all the custom code added and edited removed and the source will correspond only to the information on the screen. But the source which resulted in the parser error is actually backed up under the respective project directory's Backup directory before the source is regenerated. To avoid and resolve this ambiguity, now only the parsing error message is thrown. The user has to either clear the parsing errors or regenerate the source consciously after saving the erroneous source file. The recreate menu helps to retrieve the original source without any deletion. Shortcut

Function Shortcut

Compile Ctrl + L

Run Ctrl + R

Test with Browser F9

Page 29: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 28

8.3.1.1.5 Project Menu The Project Menu is intended to help the user in handling the projects developed as a single entity rather than as individual screens. Using the options present in this menu a user can compile, run and install a project as a single unit. The options present under this menu are explained below.

Regenerate Project This option helps the user to compile all the screens under a project rather than as individual screens as implemented by the "Regenerate" option in the "Build" Menu. Compile Project This option helps the user to compile all the screens under a project rather than as individual screens as implemented by the "Compile" option in the "Build Menu". Run Project This option helps the user to run the project as a single application. To run the project as a single application the builder needs to know the main screen (first or initial screen) of the project, from which it can start the application. Hence it prompts the user to choose a screen name from the combo box which could be the main screen of the project. The user will not be prompted for the main screen name if "Project Properties" already has a valid main screen name entry in the "Run Setup" tab. Compile And Run Project This option combines both "Compile Project" and "Run Project" into a single function strictly in the order listed. The Project is first compiled. If the compilation is successful the project will be executed subsequently. Run Project with Browser Clicking on this menu item, the project's main screen will be run in the configured browser. (If the main screen has not been configured yet, then a dialog will appear to take the input). Smart Jar The various options in Smart Jar are listed below: • Reinitialize Smart Jar • Smart Jar Log

Page 30: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 29

Usually, when the jars that are used for creating an application are selected, the number of classes used are much more than the actual number required. The concept of Smart jar is to ensure that only the classes that are required should be present in the jar and not the unnecessary classes. Also,classes in project classes are not taken in Smart jar but only classes used by the screen are included.

• Suppose that a component is used in the screen and later on it is deleted. The Smart jar would still contain this component. To remove this class, the Smart jar is reinitialized so that unnecessary classes are not present.

• "Run Time Jar Log" option keeps the Log information needed to create the Smart jar. For information on how this option works see How to optimize packing of Jar Components.

Page 31: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 30

8.3.1.1.6 Properties Menu This menu provides with a way to configure the properties to suit specific needs.

The Properties menu consists of four menu items as given below. For more details on setting the properties follow the respective links. Global Properties These specify the common properties such as web browser path, Bean width/height. etc. applicable for the whole IDE. Project Properties These specify the properties that are common to all the screens of a specific project. Screen Properties These specify the properties of a specific screen in the project. Bean Properties These specify the properties of the selected Bean. Shortcuts

Function

Shortcuts

Global Properties

F2

Project Properties

F12

Screen Properties

F4

Bean Property Form

F5

Page 32: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 31

8.3.1.1.7 Versioning Menu This menu helps to maintain a version control for the projects and screens developed in Bean Builder.

CVS Server Options: The CVS server settings are configured using this menu item. For more details refer the document 'Setting CVS Server options'. CVS login: Clicking on this menu item invokes the CVS login dialog, in which the user name and the password has to be entered. By providing the username and password, the user will be able to login into the CVS Server and perform operations like checkin, checkout,etc. in the repository. The login can also be done from the CVS Server Configuration dialog invoked by clicking the menu item 'CVS Server options'. Run CVS Command: To invoke the CVS client in order to perform CVS operations like Add File, Check in, Check out, CVS import, etc. use this menu item. For more information on all the operations, refer 'Running CVS commands'.

Page 33: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 32

8.3.1.1.8 Tools Menu

Start Servers This menu item lets the user to manage/start/stop servers used in Bean Builder. For more details refer the Features of Servers UI topic. Deployment Wizard See the topic How to deploy your project to know learn about deploying your project using 'Deployment wizard'. Package for WebNMS The application built in Bean Builder can be integrated into AdventNet Web NMS. Click here to know more about it. Policy Tool Policy tool is useful in defining Java Policy to the application built in Bean Builder. Configure Tools This option enables to integrate third party tools . The policy tool is one such tool configured. See Configuring Tools Menu for more details.

Page 34: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 33

8.3.1.1.9 Help Menu Invoking this menu launches the help file for Bean Builder in Web browser. This can also be done by pressing the F1 key.

Page 35: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 34

8.3.1.2 Toolbar Toolbar provides an easy access to the frequently used tasks during the development process. It visually represents various options wherein you can choose the icon to perform the respective operation. Pointing to an icon displays the tool tip which briefly describes the option.

New Project : You can open a new project using this option. New project with the specified name will be opened in the project tree. Then you can create new screens under this project. Open Project You can open an already existing project using this option. The project will be opened in the project tree. Cut Bean : You can cut a bean from its existing place using this option. Copy Bean : You can make a copy of a bean using this option. This option will copy a bean along with its property settings. Paste Bean You can paste a bean which is already copied or cut, using this option. This will have no effect if nothing is copied or cut. Delete Beans :When a bean is no more needed, it can deleted from the Draw area using this option. Multiple deletion of bean can also be done. Cancel : When you drag and drop a bean from the beans palette, you can drop the same in the Cancel button to cancel the dropping. New Screen : This is used to create a new screen under the currently working project. By default, this invokes the Screen Builder which helps to create a new screen. To get a blank screen of build type Applicationdisable the Screen Builder checkbox in the 'Global Properties' dialog invoked using 'Properties -->Global Properties' menu item. Save : This saves the screen that is currently selected. When you do not save the screen, the changes made are temporary as it gets reverted back when "Reload Project" option is chosen from "File" menu. Save Option can be used, when you need to make the changes permanently. Undo To Undo the previous action. Redo : To Redo the previous action. Compile : To compile the selected screen, use this option. Run : To run the individual selected screen, use this option. Bean Help : This will open javadocs for the bean that has been currently selected. Except the beans in SwingBeans.list (which are just the Java provided Swing components), javadocs for all the other beans are brought up in a Web Browser.

Page 36: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 35

8.3.1.3 Beans Palette The AdventNet Bean Builder User Interface provides various beans, which can be used in the applications built in it. The Component palette shows the collection of jars, with each jar containing a group of beans, so that the user can simply drag and drop the various components to suit his requirements.

• The Component Palette is the visual interface for the user to select and use a bean ,be it user defined or pre-defined. It is present just below the Menu Bar. In the Component Palette, each tab represents a Jar of Bean components and the icons under each tab header represents the set of Bean components corresponding to the respective jar.

• You can select the required bean by clicking on the appropriate icon and then drop it either in the Draw Area or in the invisible bean area. You can also cancel the selection by clicking on the "Cancel " button.

• The Scroll buttons on the left and right side are used to move within the Component Palette to

have a view of all the jars present in it, while the Scroll Button present for each tab (the inner set of Scroll Buttons) can be used to have a view of all the beans within the same tab whenever necessary.

• The last tab of the Component Palette is "Project Classes". It consists the list of classnames

of all the screens and files in the current project that has been loaded. One main feature is that we can drop those screens as beans in the new screen you design. Also classes available outside Bean Builder can be imported into the project using the browse button and used as beans. The below picture shows the "Project Classes" tab of the Component Palette.

Page 37: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 36

8.3.1.4 Project/Component Tree Project Tree The Project Tree is used for listing the Projects. On opening the node, the Screens and Files present inside the project are also listed. The Top Frame displays either the Project Tree or Library Tree. This depends on the selection of the tab at the bottom of the Directory Tree, viz Project Tab or Library Tab.

Searching for Project and Screen node When the user is working with a number of projects and huge no. of screens, it is difficult to find a particular project or screen node in the project tree. If the user knows the name of the project or screen, it can be easily located with the help of the search option.

To search for a particular project or screen, the user has to set the focus on the left-side project tree and type in the first few words of the project or screen name. This selects the node searched by the user. Component Tree When the beans are dropped into the screen, they get added to the Components tree present in the bottom left frame. On selecting a particular screen in the project tree, the respective list of components are displayed in the Component tree.

• When the user right clicks on a component in the Component tree with the selection in "Screen" tab, it will bring up the Component Pop up Menu same as that got by right clicking on the component in the Screen.

• When the user clicks on the component in the component's tree with the selection in "Interaction" tab, the connections of that component with different other components are displayed.

Page 38: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 37

Note: The Component Tree and the connection tree are visible only when the selection is in screen or Interaction tab.

8.3.1.5 Draw Area The Bean Builder screen is the area in which the developers can drag and drop the bean components and build their applications. The Screen consists of two panels.

• The top panel called 'Draw area' is for visible bean components and the bottom panel in white, called 'Invisible Bean Area' is for invisible bean components.

• Visible beans are visible in the screen and they have user interface. Invisible beans are represented by a rectangle in the screen and does not have an user interface.

The below picture shows the "Screen" view with visible components in the 'Draw area' and invisible component 'Combiner' in the 'Invisible bean area'.

Though the screen area is demarcated between visible and invisible beans the developers are at liberty to place the invisible components anywhere in the screen. When running the application or applet, only the visible beans are displayed. But if any of the visible components are placed in the bottom panel, it will not be displayed in the run time applet or application. To summarize, in the compiled applet or application

• Visible components placed in the top panel gets displayed while the invisible components are not.

• Any component placed in the bottom panel is not displayed even though the component is a visible component.

Page 39: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 38

8.3.1.6 JMACS Editor The operations possible in source editor can be performed using the menu items of Edit menu. Kindly note that the Edit menu will have these options only when you are in the "Source" Tab of the Tool. Some of the options provided by the Editor can be seen below.

• The basic operations for editing source like Find/Replace, Go to (Line Number), Copy , Undo, Redo. etc. can be performed in the Source Editor.

• The advanced operations that can be performed are braces matching in the code and setting Editor preferences.

o The preferences dialog is useful in setting color and font in which the code should be displayed.

o Java doc settings can be done, so that they can be invoked from the popup menu item 'Help' obtained on right-clicking the code in the editor.

• By default the code generated by the Tool between the //<Begin> and //<End> tags will be in

form of blocks. This portion of the code cannot be edited and they are represented as non-editable blocks. The "Disable Blocking" option can be used to change this, but the user should not edit the code generated by the Tool. If the code has been edited, it will be overwritten when the source is regenerated or when the screen is compiled. More explanation is given below.

Page 40: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 39

The Search Dialog, which can opened through "Edit menu-->Find/Replace or Goto"can be made as a part of the editor or kept separately. The options of the Edit menu are also available in the form of a popup that can be invoked by right-clicking on the Editor area. Edit anywhere Once you want to directly add your custom code/edit the existing source code to meet your needs, you can do it in the following places:

• Source tab • Screen Configuration UI dialog • Interaction wizard • Bean Property sheet

To add/edit the code in Bean Property sheet or Interaction wizard or Screen Menu configuration UI, you need not necessarily open the respective editors. Instead, you can edit them in the Source tab of Bean Builder. Similarly, the custom code added or modified in the source tab are reflected in the respective editors. This feature makes it easy for you to modify source at one place which will automatically be reflected in respective editors and vice versa.

Page 41: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 40

8.3.2 Using Status Window The purpose of the status window is to display the status messages of various actions performed in the Bean Builder. The status window flashes out messages when the code is generated, regenerated, compiled and tested. etc. During compilation if any error occurs, the status window pops up to the front with the error messages. A tab gets added every time a different screen is being run (with header for example, <new_screen>). This tab will contain all the messages that correspond to the specific screen being run. If the same screen is run again, the status messages of different instances are shown separately.(new_screen<1>, new_screen<2>). The Status Window also provides a text field for command line inputs and interactive commands. For example for debugging purposes, if the screen is run using jdb, then the run process can be controlled by the user defined inputs at different stages. All the messages that are displayed in the Status Window can be logged by enabling the Log Application/Applet check box of the 'Project Properties -->Debug Info'.

Page 42: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 41

8.3.3.1 Customizing Menubar The default Menubar of Bean Builder IDE provides all necessary actions and operations that needs to be performed while developing an application. The need for customization arises when wants to re-organize the Menubar or add/remove some menus/menu items. Customization is made easy with the usage of highly configurable XML file. In case, the user wants to customize the menu bar it can be done with ease using the XML Menu Framework. Inserting new menus or menu items or reorganizing the arrangement of existing menus are some of the customization that can be done to the Menubar. The following file needs to be edited in order to customize the Menubar. BB_MenuFrame.xml Consider you need to insert a new menu. The XML snippet given below depicts the representation of a Menu named 'File'. <MENU name="File" shortcut_key = "F" action_listener="com.adventnet.builder.beanbuilder.frame. NTreeAction"> . . . </MENU> The shortcut key 'F' is specified and the class name is specified as the action listener which handles the actions when the menu 'File' is clicked.

Page 43: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 42

8.3.3.2 Menu File Format The XML Menu Framework, provides a standard format to customize the menus in a client framework. The input is given in the form of a xml file. Based on the tags and attributes in the xml file, the menus are constructed. The attributes are used in three levels for the menu construction, namely Menu-Bar level, Menu level and Menu-Item level. The sample input file (input.xml) can be referred to have a better idea about the xml structure. The usage of the various attributes are explained below. Menu-bar level

Attribute Description Name The name of the Menu Bar, which is the

reference for all the menus in it.

action_handler

Specifies the class, which handles the actions passed by the menus or menu items. This handling has the lowest precedence. i.e. it can be overridden by a menu level class and/or a menu-item level class.

Menu level

Attribute Description Name The name of the menu, which is displayed in the

menubar.

shortcut_key/hot_key The key which invokes the menu, when the control/focus is in the menubar.

group_name/group

The name associated to a set of menus, which can be totally activated or deactivated when a particular action is performed. For example in a java source editor, when you are using the edit mode, the edit menu (with cut, copy and paste) can be enabled. But it does not make sense in the compile mode.

action_handler Specifies the class, which handles the actions passed by the menu items. This handling has a lower presedence. i.e. it can be overriden by a menu-item level class.

Menu-Item level Attribute Description name The name of the menu-item, which is displayed

in the menu.

shortcut_key/hot_key The key which invokes the menu-item, when the control/focus is in the menu.

accelerator_modifier The Ctl or Alt key which is used before the keystroke, which invokes the menu-item directly.

accelerator_key The key or a series of keys that is used to invoke the menu-item.

renderer_type The radio button, check box, default and custom are specified in this attribute. When the custom is specified, we should also provide a class name that handles the renderer.

Page 44: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 43

Attribute Description Image The images shown with the menu item is

specified here.

action_listener/action_observer

Specifies the class, which handles the actions when the menu-item is clicked. Any class which implements actionlistener can be given as value. It is similar to invoke class but handles the action directly (java implementation).

group_name/group

The name associated to a set of menus-items, which can be totally activated or deactivated when a particular action is performed. For example in an editor, only when a text is selected, the 'cut' and 'copy' should be enabled and otherwise it should be disabled. Here the two menu-items can be grouped and their enabling and disabling can be done in a single step.

action_type

It is a menu attribute based on whose value, a particular action gets triggered, on clicking the respective menu item. When the action_type is specified as "action_command", the value specified in the action_value parameter will be passed to the listener.

action_value It is the value of the corresponding action-type. It can can be the complete path of the user defined class, URL, PANEL-KEY, etc.

enabled The option to specify whether the menu item has to be enabled or disabled by default.

selected The option to select a radio button or a check box by default.

button_group The group specified for a set of radio buttons, which are dependent.

The only mandatory attribute in each of the three levels is the "name".

Page 45: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 44

8.3.4 Popup Menus Popup menu gives you the ease of use of tools at fingertips. The popup menu that comes up on right clicking a bean pertains to the bean functions and the popup menu that comes up on right clicking the screen is specific to the screen. All the menus are explained below. Bean Popup Menu The menu items available on right clicking on the bean component in the screen or the component tree are

Edit

Choosing this menu invokes a sub-menu containing menu items 'Cut', 'Copy', 'Paste' & 'Delete'.

• Copy: To copy the selected bean to buffer. • Cut: To cut the selected bean and copy to buffer. • Paste: This menu item is enabled only if bean is copied in buffer. On choosing the

'Paste' menu item the copied bean in buffer is pasted on the desired area. • Delete: To delete the selected bean.

Layout Properties

This menu item is disabled for Null Layout. On selecting this menu item the Layout Property dialog for respective Layout is invoked, wherein you can configure the bean arrangement. To know usage of this option follow the link Laying out Components.

Layout

User can set the layout of a container using this menu item. To know usage of this option follow the link Laying out Components.

Page 46: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 45

Property Form

Choosing this menu item invokes the Bean Property Form for respective beans. In the Property Form you can set the 'setter' methods for the Bean instance. For usage of this Property Form follow the link Setting Component Properties.

Interaction Wizard

Selecting this menu item invokes a sub menu, which lists the action listeners possible for the selected bean. For usage of this option follow the link Setting up Interaction between components.

Lock Position

Checking the 'Lock Position' locks the position of the selected bean. So you cannot move the selected bean component from the current position. This is useful in preventing the beans moved accidentally.

Cascade

This is used to lock/unlock the position of the components recursively. This will be very much useful in layouts because the slight shaking of a component will change the component position.

Popup Menus

All the popup menus created using Screen Menu configuration UI are listed here. Any one of the listed popup menu can be associated to the selected bean.

Reload Bean

Selecting this menu item reloads the selected beans. For more information, refer Reload Beans.

Replace Bean

This is used to replace a bean in the draw area with a different bean that can be chosen from the set of jars. For more details refer Replace Beans.

Add to Standards Selecting this menu item will add the Look and Feel parameters to the Standards file which is selected in the 'User Look and Feel Standards File' in the General Tab of the Project Properties dialog. For detailed usage of this feature follow the link Setting Look and Feel Standards. Help This gives the java API for the respective bean component.

Page 47: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 46

Screen Popup Menu The menu items available on right clicking the screen are

Edit

Choosing this menu item invokes the standard sub-menu 'Paste'. This menu item is enabled only if bean is copied in buffer. On choosing the 'Paste' menu item the copied bean in buffer is pasted on the desired area.

Layout Properties

This menu item is disabled for Null Layout. On selecting this menu item the Layout Property dialog for respective Layout is invoked, wherein you can configure the bean arrangement. To know usage of this option follow the link Laying out Components.

Layout

User can set the layout for a container using this menu item. To know usage of this option follow the link Laying out Components.

Panel properties

Choosing this menu pops-up the property form of the panel (i.e.) draw area. User can set the required properties in this form which will take effect in the draw area.

Screen Properties

This form contains some screen related properties such as look and feel and screen title. For more details refer Screen Properties.

Project Properties

The Project Properties form is useful for setting the properties of the whole project like runtime parameters, compilation, class path settings, source generation. etc. For more details refer Project Properties.

Page 48: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 47

Cascade

This is used to lock/unlock the position of the components recursively. This will be very much useful in layouts because the slight shaking of a component will change the component position.

Replace Beans

This is used to replace a bean in the draw area with a different bean that can be chosen from the set of jars. For more details refer Replace Beans.

Menus

Using this menu item, user can create their own menu bar, toolbar and pop-up menu's and enable it whenever needed. For more information follow the link

• Adding Menu Bar to Applications. • Adding Tool Bar to Applications. • Adding Pop-up Menus to Components.

Run Time View

This gives a view of the screen as it would appear in the runtime. Connections and other property setting can be done in Run Time View also but the only drawback is that it won't take into consideration the look and feel.

Project Popup menu The popup menu available on right clicking a project node is given below.

Save: To save the currently working project. Reload: To reload the currently selected project. Paste screen: To paste the screen copied from the same or different project. Delete: To delete the selected project. Close: To close the selected project. Properties: To view the Project properties of the selected project. CVS Options:

• CVS Server Options: To invoke the CVS server options dialog box. To learn more about setting server options, refer this topic

• CVS Login: To login to the CVS Server. You can also login from the CVS Server options dialog box

• Run CVS Command: To invoke the CVS client in order to run CVS commands like Add, Check in, Check out , etc.

Page 49: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 48

Screen Popup menu

Save: This menu item is used to save the currently selected screen. Cut: This menu item is used to cut the selected screen from the project. Copy: This menu item is used to copy the selected screen from the project. Rename: This menu item is used for renaming the currently selected screen. On selecting this menu item the name becomes an editable text field in which you have to provide the valid screen name (preferable class name convention in Java) and press 'Enter' key. Delete: This menu item is used for deleting the currently selected screen. Properties: This menu item is used for bringing up the Screen Properties dialog for the currently selected screen. CVS commands:

• Check in: To check in the screen into the CVS repository use this opiton. This will check in both .config and .java files of the selected screen.

• Check out: To check out the screen from the CVS repository use this option. This will checkout both the .config and .java files of the selected screen.

• Status: To view the status of the selected screen use this option. • Update: To update the screen with the latest revision of the screen in the repository and to

merge your changes locally, use this option. • Log: To display the log information of the screen, use this option. • Diff: To display the differences between the screen in cvs repository and your local copy, use

this option. • Add File: To add a new screen to the project in cvs repository use this option. • Run CVS Command: To invoke the CVS client in order to perform all the above said cvs

operations use this option.

Page 50: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 49

File Popup menu

Close: This menu item is used to close the file. CVS commands:

• Check in: To check in the screen into the CVS repository use this opiton. This will check in both .config and .java files of the selected screen.

• Check out: To check out the screen from the CVS repository use this option. This will checkout both the .config and .java files of the selected screen.

• Status: To view the status of the selected screen use this option. • Update: To update the screen with the latest revision of the screen in the repository and to

merge your changes locally, use this option. • Log: To display the log information of the screen, use this option. • Diff: To display the differences between the screen in cvs repository and your local copy, use

this option. • Add File: To add a new screen to the project in cvs repository use this option. • Run CVS Command: To invoke the CVS client in order to perform all the above said cvs

operations use this option. Connection Popup menu This pop up menu is obtained by right clicking the connection in the connection tree. For explanation on the menu items of this pop up menu, refer topic "Editing Component Interactions".

Page 51: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 50

8.3.5 Setting Global Properties of Bean Builder IDE These are the common properties that apply to the whole of Bean Builder IDE. This is configured using the Global Properties dialog, which is invoked using the "Properties --> Global Properties" menu item or by pressing shortcut key F2. These properties can be configured. The following is the Global property list of AdventNet Bean Builder.

• Web Browser - It is used for testing the application in browser. The path where the binary executable file of the browser lies must be specified here.

• Bean Width Min - The minimum width for the bean components. • Bean Height Min - The minimum height for the bean components. • Screens in Memory - The no of screens that is remembered by the Bean Builder while

working with huge no. of screens. • Actions in Memory - The undo/redo action limit. • Error Log File- The file name to store the error messages. • Output Log File - The file name to store the 'System.out.println' messages if any. • Projects To Load - The projects to be loaded automatically when the tool is started next time

are listed in this combo box. To choose the projects click on the "Browse" button to invoke the "Projects to Load" dialog as shown below. The projects to be loaded can be chosen in this dialog and to remove any of the projects from the list, use the "Delete" key.

Page 52: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 51

The 'log' check box needs to be checked to start logging in the respective log files mentioned. Enable Screen Builder By default, this checkbox is enabled and the Screen Builder is invoked while creating a new screen. If the user does not want to make use of this option, disable this checkbox. Now clicking on the new screen icon in the toolbar or choosing the File --> New --> Screen menu item creates an empty screen of build type Application, ignoring the Screen Builder.

Page 53: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 52

8.3.6 Using Context Sensitive Help Context Sensitive Help in Bean Builder provides information about what users see in the tool. It depends on where you are in the tool and gives relevant information about the task you are trying to accomplish. It is invoked by clicking on the Help button and then clicking on the field or object in a dialog, for which help is needed. For example, the below picture shows the Interaction wizard opened for making a connection. Here the component which is clicked for the context sensitive help is the Connection Class "Type".

The Help about the specific component appears in a popup window. This kind of Help looks very much like tool tip that appear when users pause the mouse over toolbar buttons and other components. The Help popup window also gives a link to view the respective help document, in addition to the brief help provided in few lines. The help image cursor that appears with a cross indicates that the help is not available for the field or object the user is moving across in a dialog. Thus, the Context Sensitive Help provides information at the moment of need and reduces user's frustration in searching the whole of the Bean Builder's Help document to find a topic or information.

Page 54: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 53

8.4 Working with Projects To create an application using the Bean Builder environment you must initially create a project to work with. This project is organised under the projects folder of the <Web NMS Home> directory. Project A Project is a holder of resources that make up the Application. The resources include Screen, Images. etc. The information about each Bean Builder project is saved in a file that has a .proj extension. This project file contains reference to the list of screens used in the project and also the project specific properties. Bean Builder uses the information in the project file when you load, save, compile and run the project. Contents of Project directory The Projects created in the Bean Builder are stored in this directory. When a Project is created the .proj file and a folder in the name of the project is created. This folder contains the following folders. BackUp - The Backup files for deleted screens and modified Source files is stored in this folder. To know more about Screen/Source back up, read the topic 'Screen/Source code Backup'. classes - The compiled classes are stored in this folder. Also users can add .class files for classes created outside Bean Builder. html - The html file generated for driving the applets in the Browsers. This is applicable only for the Project's Screens with build type applet. Images - The images used in the project are stored in this folder. jars - The jars used in the Project are stored in this folder. Screens - The Screens in the Projects are stored in the format of .config files. This config files are parsed to load the screens. To know more about screens, refer Working with Screens. Source - The Source code (.java files) for all the Screens are generated and the Java Files created in Project are saved in this Folder. The files include the auto-generated source for the screens, connection files and user created Java files. template - The customized template files for the particular project are stored in this directory. tmpSource - The latest version of the java files are stored in this directory and during compilation, this version is taken and compiled. README.txt This file contains the description of the project which you have typed in the Project Description editor of the Project Properties form. It is added on to the preface of the project as the title page. Viewing the Projects Created project is loaded in the tree structure as a node and the screens can be viewed by opening the node. From one screen we can move to another screen by clicking the required screen in the tree structure.

Page 55: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 54

8.4.1 Creating a Project To create a new project, use New --> Project option under the File menu. A dialogue box appears which prompts for the project name and package name. On entering the project name and clicking ok, a new project file <project name>.proj and a folder of the same name is created under the <Web NMS Home>/projects directory. By default the project does not contain any screens or files.

Page 56: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 55

8.4.2 Setting Look and Feel Standards The need for Look and Feel Standards are met by providing a distinctive platform independent appearance and standard behaviour. The standards for user interface separates the implementation of interface elements from their presentation, enabling an application to dynamically choose how its user interface elements interact with users. The Bean Builder complies to the AdventNet Look and Feel standards by providing options to design a user interface that provides a standard representation to the kind of usability that the designer expects. But this does not imply that the designer does not have any other option to specify the kind of look and feel he desires. Other than AdventNet Look and Feel Standards, the User Defined Standards and None are the options provided. Thus if the user has to design a single screen or multiple screens, there is no requirement to specify the properties at the onset of each screen or dropping of each bean. Properties once set can be retained till the completion of the whole project. Setting various UI standards?

AdventNet Look and Feel standards:

The "Properties menu" contains the "Project Properties" menu item. Select the "General" tab in the dialog that appears. In the combo box corresponding to Look and Feel Standards , select the "AdventNet Look and Feel" option and click the "OK" button to confirm your selection. All the components dropped after selecting this option will follow the ALF (AdventNet Look and Feel ) standards in the screens designed. The ALF standard is the default Look and Feel option selected for all the Bean Builder projects.

User defined Standards:

You can define your own set of standards by using this option. In the combo box corresponding to "Look and Feel Standards" of the "Project Properties-->General" tab , select the "User Defined Standards" option. You can find that a text field below the combo box corresponding to the "User Look and Feel Standards File" option gets enabled. The name of the file specified here is the one to which the User defined standards are getting added. By default we have provided a file by the name Standards.alf that is present in the <Web NMS Home>/builderdata directory. Close the Project Property form using the "OK" button.

Now in the screen view, after dropping the bean component modify the bean properties to suit your UI taste using the Bean property form. Say you change the background to white, right click on the bean and a pop-up menu appears where the menu item 'Add to Standards' is found. Click on this to add the properties set for this bean to the 'User Look and Feel Standards File' (the file provided in the project property form- Standards.alf). The next time you drop a bean of the same type it will have the properties that you have added to the Standards File. In case you specify the name of a file that is not existing, the tool creates the file for you. In this way you can create files that contain standards specific to a project.

Warning: The ALFStandards.alf file is the AdventNet Look and Feel Standards file and the users are advised not to browse and select this file as the User defined Standards file, since this may cause damage to the tool.

Note : By default the Standards.alf file has properties that meet the ALF Standard. The ALF standards in this file are overwritten with the customized standards when the user-defined properties are set.

Page 57: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 56

None:

If the user requires neither ALF Standards nor User Defined Standards, then the "None" option can be used. In the combo box corresponding to "Look and Feel Standards" of the Project Property Form, select the "None" option.

Note: The Add to standards menu item obtained from the popup menu which is obtained by right clicking on bean components, is not enabled for ALF Standards or None options.

Standards compliant Menus and MenuItems : The source generated for the menus and menu items also reflect the Look and Feel Standard selected in the Project Property Form. Thus UI is complete in all aspects with respect to the selected Look and Feel Standard.

ALF Standards

The motto behind the AdventNet Look & Feel Guidelines [ALF Guide] is to provide a standard look and feel for various AdventNet products. The Usability of a product is the one which interacts first with the user. Hence it is very important to consider the usability of the product while developing various components.

AdventNet Look and Feel is the default interface for applications built with the Java Foundation Classes. The AdventNet look and feel is designed for cross-platform use and can provide:

• Consistency in appearance and behavior of common design elements. • Compatibility with industry-standard components and interaction styles. • Aesthetic appeal that does not distract from application content and Feel is based on

java UI standards, but it is specific to AdventNet Bean Builder.

The ALF standards can be viewed from the ALF Guide that is bundled with this document.

Page 58: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 57

8.4.3 Setting Look and Feel Standards The need for Look and Feel Standards are met by providing a distinctive platform independent appearance and standard behaviour. The standards for user interface separates the implementation of interface elements from their presentation, enabling an application to dynamically choose how its user interface elements interact with users. The Bean Builder complies to the AdventNet Look and Feel standards by providing options to design a user interface that provides a standard representation to the kind of usability that the designer expects. But this does not imply that the designer does not have any other option to specify the kind of look and feel he desires. Other than AdventNet Look and Feel Standards, the User Defined Standards and None are the options provided. Thus if the user has to design a single screen or multiple screens, there is no requirement to specify the properties at the onset of each screen or dropping of each bean. Properties once set can be retained till the completion of the whole project. Setting various UI standards?

AdventNet Look and Feel standards:

The "Properties menu" contains the "Project Properties" menu item. Select the "General" tab in the dialog that appears. In the combo box corresponding to Look and Feel Standards , select the "AdventNet Look and Feel" option and click the "OK" button to confirm your selection. All the components dropped after selecting this option will follow the ALF (AdventNet Look and Feel ) standards in the screens designed. The ALF standard is the default Look and Feel option selected for all the Bean Builder projects.

User defined Standards:

You can define your own set of standards by using this option. In the combo box corresponding to "Look and Feel Standards" of the "Project Properties-->General" tab , select the "User Defined Standards" option. You can find that a text field below the combo box corresponding to the "User Look and Feel Standards File" option gets enabled. The name of the file specified here is the one to which the User defined standards are getting added. By default we have provided a file by the name Standards.alf that is present in the <Web NMS Home>/builderdata directory. Close the Project Property form using the "OK" button.

Now in the screen view, after dropping the bean component modify the bean properties to suit your UI taste using the Bean property form. Say you change the background to white, right click on the bean and a pop-up menu appears where the menu item 'Add to Standards' is found. Click on this to add the properties set for this bean to the 'User Look and Feel Standards File' (the file provided in the project property form- Standards.alf). The next time you drop a bean of the same type it will have the properties that you have added to the Standards File. In case you specify the name of a file that is not existing, the tool creates the file for you. In this way you can create files that contain standards specific to a project.

Warning: The ALFStandards.alf file is the AdventNet Look and Feel Standards file and the users are advised not to browse and select this file as the User defined Standards file, since this may cause damage to the tool.

Note : By default the Standards.alf file has properties that meet the ALF Standard. The ALF standards in this file are overwritten with the customized standards when the user-defined properties are set.

Page 59: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 58

None:

If the user requires neither ALF Standards nor User Defined Standards, then the "None" option can be used. In the combo box corresponding to "Look and Feel Standards" of the Project Property Form, select the "None" option.

Note: The Add to standards menu item obtained from the popup menu which is obtained by right clicking on bean components, is not enabled for ALF Standards or None options.

Standards compliant Menus and MenuItems : The source generated for the menus and menu items also reflect the Look and Feel Standard selected in the Project Property Form. Thus UI is complete in all aspects with respect to the selected Look and Feel Standard.

ALF Standards

The motto behind the AdventNet Look & Feel Guidelines [ALF Guide] is to provide a standard look and feel for various AdventNet products. The Usability of a product is the one which interacts first with the user. Hence it is very important to consider the usability of the product while developing various components.

AdventNet Look and Feel is the default interface for applications built with the Java Foundation Classes. The AdventNet look and feel is designed for cross-platform use and can provide:

• Consistency in appearance and behavior of common design elements. • Compatibility with industry-standard components and interaction styles. • Aesthetic appeal that does not distract from application content and Feel is based on

java UI standards, but it is specific to AdventNet Bean Builder.

The ALF standards can be viewed from the ALF Guide that is bundled with this document.

Page 60: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 59

8.4.4 Compiling and Running Projects The projects developed using Bean Builder can either be compiled separately and then run or directly compiled and run with a single option. You can compile the project in either of the two ways mentioned below.

• From Project menu select Compile Project Menu item. • Click the Compile icon in the toolbar, in the second row and fifth column.

Thus the project is compiled with the required classes. The log messages and the error messages (if any) are displayed in the Status window. You can toggle the visibility of the Status Window by selecting the Status Window menu item from View menu or by pressing F7 key. You can run the compiled project in either of the two ways mentioned below.

• From Project menu select Run Project Menu item. • Click the Run icon in the toolbar, in the second row and sixth column.

Thus the project is run and the output is shown as an applet or an application. You can get the feel of the application here. You can directly compile and run the project by selecting the Compile and Run Project Menu item from the Project menu.

Page 61: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 60

8.5. Working with Screens A Screen is the working area available to the user. Any number of required screens can be created in a Bean Builder project. For any project only one main screen is allowed, to which sub-screens are either added or invoked from. But each screen can be unit tested separately. Setting Build type for Screens The Build type of a screen can be chosen in the Screen Builder while creating a new screen. To know more about Build types, read the topic elaborating the Build menu. On creating a new screen by finishing in the first screen in the Screen Builder, the Build type is Application by default. It can be changed to any other Build type using the menu item "Build --> Type". Viewing the Screen The Screen tab of Bean Builder IDE, which is chosen by default shows the Screen view. To know more about this, refer the Draw Area topic. Setting Screen Properties The properties of an screen can be changed by using Screen Properties dialog. See Setting Screen Properties for more information. Saving the Screen The screens created can be saved using this option. This creates the configuration and java files of the corresponding screen and places it under 'Screens' and 'Source' directories respectively. For example, on creating a new screen of name say 'test' and saving the screen the corresponding config and java files are created under Screens and Source directories respectively. i.e. 'test.config' is created under <Web NMS Home>/projects/My_proj/Screens directory and 'test.java' is created under <Web NMS Home>/Projects/My_proj/Source directory. Regenerating source for a screen Regenerate menu item under the Build menu creates the source (.java) file for the corresponding screen. The following are the circumstances under which the source is automatically regenerated:

• Saving the screen. • Switching between Screen and Source tabs. • Compiling the screen. • Renaming an existing screen. • Changing the Build Type (For instance applet, application,panel ,dialog etc) of the screen.

Page 62: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 61

8.5.1 Build Type of Screens Screens are the containers which can hold Menu Bar, Tool Bar and Bean Components. The Screen can have the desired build type depending on the usage of the final screen as given below. Each Screen can be set with a desired Layout for laying Components in a structured arrangement. This Build Type can be set using the Menu Build-->Type.

• Application : This build type is useful for building the main screen of a Standalone application. Hence you can configure Menus, Tool Bar to navigate to the various dialogs, Frames,etc. to perform actions.

• Console Application : This build type is useful for building non GUI based console applications.

• Applet : This build type is useful for building applications which can be run in the Internet Browsers. It is useful especially in building web based applications.

• Frame : Frame build type is mainly useful for windows or dialogs invoked as action of a tool button, Menu item, etc. Frame can be a standalone container but dialogs can be invoked from other Screen build types.

• Nms Frame : Nms Frame is only useful for building Screens to be integrated with AdventNet Web NMS.

• Panel : A Panel is a container which can hold a set of components, this is helpful in splitting a Screen into several parts. Panels should be used as containers in Split panes.

• Nms Panel : NMS Panel build type is same as Panel build type and useful for building applications to be integrated with AdventNet WebNMS.

• Dialog : Dialog build types are containers which can be invoked only from other Screens.

Page 63: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 62

8.5.2 Creating screens using Screen Builder Screen Builder is a user friendly wizard which is helpful in building new screens of various build types using different screen templates. Screen Builder minimizes the effort and time by doing basic designing of the UI. It takes care of using the right layout, components and connections for the selected template. Screen Builder asks for step by step input from you and on finishing all the steps the screen is created under the selected project. You need not necessarily complete all the steps in order to create a screen. You may quit in between any of the intermediate steps and a screen based on the provided inputs will be created. To disable the Screen Builder and directly create a blank screen, go to Properties --> Global Properties menu item and disable the corresponding option.

How to create a new screen On choosing File --> New --> Screen menu item or clicking on the New screen tool button, the Screen Builder is invoked. The Screen Builder is invoked by default as set in Global properties dialog. New screen will be created based on the inputs provided in the Screen Builder wizard. The new screen can be set with any build type such as 'Application', 'Applet', 'Frame', 'Panel'. etc. in the first dialog of Screen Builder. To learn about various Build types, read the topic elaborating on 'Build' menu. There are basic screen templates available for each build type. To know more about screen templates, read the topic 'Choosing Screen Templates'.

Page 64: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 63

8.5.3 Choosing Screen Template Generally, after choosing the Build type of your screen you will start building the UI. You may design your UI as a wizard or Split pane or anything else according to your requirement. Screen Builder helps you to design the UI by providing few basic templates. How to choose Screen Template According to the Build type you have chosen, the Screen Builder offers you a set of templates. The template can be selected in the second dialog of the wizard. If you do not want to use any of the available templates, then you can create a blank screen by following any one of the following steps

• Clicking on the 'Finish' button in the first dialog itself • Choosing 'Blank Screen' as the screen template in the second dialog of Screen Builder and

clicking on the 'Finish' button • Choosing 'Blank Screen' in the second dialog and entering the screen details in the third

dialog to set the name, height, width, look and feel etc. for the blank screen; now clicking on the 'Finish' button creates a blank screen with the specified settings

The screen templates can be classified into Main -screen templates and sub- screen templates according to their usage. The screens built using the main screen templates forms the core component of the project. Various screens can be built as sub screens to this screen. The Main screen templates are Wizard and Split Pane. These two templates are applicable for build types 'Applet', 'Application', 'Frame' and 'NMS Frame'. The screens built using the sub screen templates will be used from the Main screen and can be run independently for testing purpose. They can be invoked from screens built with main screen template or be a component of the Main Screen itself. Screen Templates for build type ' Panel', 'NMS Panel' and 'Dialog' are classified as sub screen templates and they are listed below:

• List panel • Log panel • Label Text Field Dialog • About Dialog

Page 65: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 64

8.5.3.1 Main Screen Templates The main screen templates are Wizard and Split Pane. The advantage of choosing these screen templates and creating a screen using them are detailed in this topic. Choosing Wizard A Wizard is a series of screens controlled using buttons in order to accomplish a task. Wizards are good UIs since you can get back to any step if stuck in between. Wizards are user friendly as it asks for step by step input. It is very useful for a new user, who does not know the sequence of steps to be performed to accomplish a task. Choosing Split Pane A Split pane is a screen which divides two components and displays them side by side. The Split Pane created using Screen Builder contains a tree on the left and a Jpanel set with card layout on the right. Menu Bar, Tool Bar and Status Bar are the additional options provided for designing the UI. On selecting a node in the tree, the right side should be loaded with the respective container. For example, this type of UI will be useful when the user needs to configure numerous properties. The properties can be grouped logically and individual screens can be made for each group. Let each node of the tree represent a group of properties, so that on clicking a node the respective screen is displayed. This can be done by setting in the Card Layout Properties of the JPanel and providing user code to show the respective cards on clicking the nodes of the Jtree.

Page 66: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 65

8.5.3.2 Sub Screen Templates Sub-screen Templates are useful in building screens which are generally not run separate and independent as an application. They are either invoked from the main screen or else form a part of the main screen. The screen templates offered for Panel and NMS Panel are used as sub-screens. They are

• Log Panel • List Panel.

The screen templates offered for the build type 'Dialog' are also used as sub-screens only. They are

• About Dialog • Label Text Field Dialog.

Choosing among the above sub screen templates and their usage are discussed in this topic. Choosing Log Panel A screen built using log panel template will be useful to record the error messages and output text obtained on running a main application. This template provides a text area to log messages, a clear button to erase the text and a close button to close the dialog. Choosing List Panel A screen built using List Panel template will be useful when some of the items in a list needs to picked up and used in the main application. On using this template, a screen with a list on the left and a list on the right side is created. The items on the left side list can be selected and added to the right side by using the Add button. The items on the right side list can be removed using the Remove button. Choosing About Dialog The About Dialog is a simple screen which displays some image on invoking the dialog and closes the dialog on clicking the OK button. It has no other functionality. It is generally used in the About menu item to show information about an application/product/company. etc. Choosing Label Text Field Dialog To design a screen with set of labels and text fields use this template. This type of screen will be useful for collecting some input information from the end user. For example, a person's name, age, sex, address. etc. can be collected as input for a main application by using the dialog built with this template.

Page 67: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 66

8.5.4 Creating and Deleting Screens

Creating a Screen You can create any number of screens by using the new screen option present in the file menu or by using the new screen icon in the tool bar. This invokes the Screen Builder by default. Creating screens using the screen Builder is elaborated in the topic: Creating new screen using Screen Builder. Deleting a Screen You can delete the screen by right clicking on the screen label and selecting Delete. When you delete the screen its reference is removed from all the places.

Page 68: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 67

8.5.5 Setting Screen Properties The Screen Properties are the properties that are specific to the Screen. These Properties can be edited in the dialog invoked using the menu item 'Screen Properties' of the 'Properties' Menu or by pressing F4 key.

Look and Feel This sets the Look and Feel of the Screen i.e. for your application being built .This look and feel is applied to the screen at runtime. The various kinds of look and feel available for a screen are metal, CDE/Motif , Windows, System Look and feel, Cross platform look and feel and none.

• Metal (Java look and feel): The Java look and feel is designed for use on any platform that supports the JFC.

• Windows (Microsoft Windows): The Microsoft Windows style look and feel can be used only on Microsoft Windows platforms.

• CDE/Motif: The CDE style look and feel is designed to use on UNIX® platforms. It emulates OSF/Motif 1.2.5, which ships with the SolarisTM 2.6 operating system. It can run on any platform.

• System Look and Feel: This sets the look and feel based on the system OS. • Cross Platform Look and Feel: This look and feel is the same as Metal, which can be used

across any platform. • None: This sets the default look and feel which is the same as Metal.

Title: Enter the title name which should appear in the title bar on running the screen.

Page 69: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 68

8.5.6 Compiling and Running a Screen You can compile and run individual screens also. The options are present under the Build menu. On compiling a screen, the .class file is created and placed under classes directory of the corresponding project's directory. The Screens developed using Bean Builder can either be compiled separately and then run or directly compiled and run with a single option. You can compile the screen in either of the two ways mentioned below.

• From Build menu select Compile menu item. • Click the Compile icon in the toolbar, in the second row and fifth column.

Thus the screen is compiled with the required classes. The log messages and the error messages (if any) are displayed in the Status window. You can toggle the visibility of the Status Window by selecting the Status Window menu item from View menu or by pressing F7 key. You can run the compiled screen in either of the two ways mentioned below.

• From Build menu select Run menu item. • Click the Run icon in the toolbar, in the second row and sixth column.

Thus the screen is run and the output is shown as an applet. You can get the feel of the application here. You can directly compile and run the screen by selecting the Compile and Run menu item from the Build menu.

Page 70: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 69

8.6. Working with Files When the user needs to implement a functionality which does not involve any User Interface, a source file can be added to the project directly. This helps the user to create his own custom java file to be used in the project. The options to create, modify, delete, compile and run the files are discussed in this section.

Page 71: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 70

8.6.1 Creating, Modifying and Deleting Files

Creating a New File To create a new java file, use the menu item 'File -->New --> File'. This invokes a New File dialog. Specify the File name, Package name (project name by default), fully qualified name of the parent class for 'Extends', location of the source files and Interface lists if any. On providing the required details, a new java file is created. The screen and Interaction tabs are disabled, as the user needs to edit the source code only. Modifying a File Bean Builder can be used to perform the function of an Editor. Any file can be opened and edited in the Source view. The following are some of the file types that can be edited: .java, .html, .mib, .idl, .config, .txt. etc. Deleting a File You can remove the unwanted file from the project tree by using the close option. This is done by right clicking the file node and using the close option.

Page 72: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 71

8.6.2 Compiling and Running Files You can open any java file and compile and run the same using the tool. The options used to compile and run the files are similar to that of the screens. Since there is no intelligence to resolve the build type of the file, you must select it manually from the Build Type menu item. The package name for a file can be set same as the project package or different from the project package name. The java files can either be compiled separately and then run or directly compiled and run with a single option. You can compile the file in either of the two ways mentioned below.

• From Build menu select Compile menu item. • Click the Compile icon in the toolbar, in the second row and fifth column.

Thus the file is compiled. The log messages and the error messages (if any) are displayed in the Status window. You can toggle the visibility of the Status Window by selecting the Status Window menu item from View menu or by pressing F7 key. You can run the compiled file in either of the two ways mentioned below.

• From Build menu select Run menu item. • Click the Run icon in the toolbar, in the second row and sixth column.

Thus the file is run and the output is shown as an applet. You can directly compile and run the file by selecting the Compile and Run menu item from the Build menu.

Page 73: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 72

8.7. Working with Beans A Java bean is a software component that has been designed to be reusable in a variety of different conditions. A Java Bean can be defined as a reusable public class with an empty constructor. A JAR file allows you to efficiently deploy a set of classes and their associated resources. With the help of this jar file, the Java Bean can be reused. One main advantage of the Java bean is that some of its characteristics are exposed visually and user code need not be manipulated manually to change a property. The characteristics are:

• Bean Properties • Events • Methods

The properties are exposed in the Property Form, which can be invoked by double clicking a bean or right clicking and choosing 'Property form' from the popup menu. In this Property Form, the various properties along with their corresponding state are displayed. These properties can be modified as per the users requirement. All the events and public methods are also listed. Classification of Beans in Bean Builder JavaBeans in Bean Builder can be classified as

• UI Beans • Containers • Windows • Non-UI Beans

UI Beans : These beans are used to give a visual representation of events. The list includes LEDs, Cellular Gauges, TextFields, Dials, Digital Displays, Image Labels etc. Containers: The Container is a Component that contains other Component(s). One such Container is JPanel that can have a number of other Components housed in it. The Containers can be used to arrange the contained Components in various layouts. This can be done by the use of various layout managers. Windows: A window can be considered as a Component higher up in the hierarchy level that extends the java.awt.window. Components can be easily embedded or dropped into a window but the vice versa (dropping a window into another container) is not possible. A window is standalone and is used in the form of a JFrame or a JDialog in the Bean Builder. In case a window (screen) is dropped onto a screen in the Bean Builder, it is represented similar to a Non-UI Bean - as a label with a text on it. Non-UI Bean: The Non-UI Beans are those that cannot be visualized during runtime. They are represented as labels with text displayed on them. Even if they are dropped on the visible area it will not be visible during runtime in the application or applet. Examples include Combiner, JDBC Adapter. etc.

Page 74: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 73

8.7.1 Searching for Beans When the user knows the name of the Bean, but not able to locate it among the tabs in Component palette, it can be searched using the library mode. The Library mode lists the set of all jars that are loaded in the projects. This mode is useful in visual representation of the beans with their bean names in the tree. The user has to give focus to the tree containing the Jars List that comes up to the left of the screen in the Library Mode by clicking there and start typing the name of the Bean. Once the bean has been located, it can be selected and dropped in the screen similar to dropping a bean from the Component palette. For example, the below picture shows the library mode, in which JLabel was searched. Now selecting the JLabel from the list and clicking in the draw area, drops the bean "JLabel" in the screen.

After dropping components into the screen one can switch from library tab to the project tab to establish connections and to build projects.

Page 75: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 74

8.7.2 Reloading Bean The "Reload Bean" option helps the user to update the properties modified in a particular bean. To use this feature, select the particular bean, right click and select the option "Reload Bean". If a screen is modified and compiled after it has been dropped as a bean, the changes will automatically be updated in the dropped bean during runtime. However for design time update, use the "Reload Bean" option in the Popup menu of the dropped bean. The Reload option updates the modified properties of the bean and the custom code written for the bean will also be integrated. For example, consider a screen designed with a particular bean. Now this screen is dropped as a bean in another new screen using the "Project classes" tab of the Component palette. When some properties of the bean in the first screen has been changed, it will not be reflected in the second screen (where the first screen has already been dropped as a bean). Using the "Reload" option updates the modified properties of the bean in the second screen.

Page 76: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 75

8.7.3 Replacing Bean You can use the replace bean option when you decide that another bean better describes and meets your new requirements. To use this option select the bean, right click and select the option "Replace Bean". A dialog is invoked as shown in the figure below with two radio options "From palette" and "Custom Class". The usage of the two radio button options are explained below.

• From Palette Suppose you want to replace a particular bean after setting many properties and you have also written your custom code by using the particular instance of the bean. Now, you can use this option to replace the bean with a new bean without losing the properties being set and there is no need to edit the custom code. The replaced bean will have the same instance of the older bean. The bean can be replaced with any other bean in the Component palette, provided both the beans extend the same classes and have similar methods. e.g., JTextField bean can be replaced by JPasswordField. Replacing Beans will be useful when you do not want to lose the bean properties set and the connections that are already made using the older bean. When a bean is replaced by another bean, it also depends on the layout compatibility between them. The following are the notable points which are involved in the replacement of beans.

• Replacement of Beans is allowed between beans with Layout support. i.e. JPanel, a bean with layout support can be replaced by another bean like Dial which also has layout support.

• Replacement of Beans is allowed between beans without Layout support. i.e. a bean without layout support like JButton can be replaced by another bean without layout support like JTextField.

• Beans without layout support can be replaced by beans with layout support. e.g: JButton (without layout support) can be replaced by Jpanel (with layout support), but the property like "Text" which was set for JButton would not be applied for JPanel.

• Alternatively, the beans with layout support cannot be replaced by a bean without layout support. For example, a JPanel with Flow layout as default cannot be replaced by a JButton which has no layout support. If the user attempts to replace beans with incompatible layouts, an error message is thrown in the status window.

Note: When a bean is replaced by another bean of compatible layout, it is also necessary that both the beans have similar properties (i.e. similar methods and extends for both classes) for logical replacement. All the properties set for a bean would be applied to the replaced bean, only when there is logical replacement.

The 'Replace Beans' option is available by right clicking the container screen, which allows the user to replace all the beans in the container screen one by one. This option opens up a dialog box listing all the beans that are present in the Draw area (i.e. the container screen) and any of the beans can be replaced with another bean in the palette using this option.

• Custom Class

Page 77: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 76

To replace a bean with a Custom Class we can use this radio option. Select the required Custom Class using 'Browse' button and click 'ok'. Now this Class can be used like any other bean in the Screen View.

Page 78: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 77

8.7.4 Adding Beans to Palette The Bean Builder does not restrict you to use its components alone. If you feel the need to load other jars and use the beans in them to create applications and applets, the Bean Builder lets you do that. Beans can be loaded or unloaded by using the "Load Jar" and "Unload Jar" option of the 'File' Menu. The Component Palette is the visual interface for the user to select and use a bean, be it user defined or pre-defined. Click here to view the Component Palette and its details. Different file formats (*.jar, *.list,*.bxml) are allowed for loading. Once a file has been loaded, it is visible in the Component Palette. The below picture shows the dialog invoked, when "File-->Load Jar" option is chosen.

• If the file needs to be auto loaded every time in the start up, then the "Load it every time" option needs to be selected. Among the list of files loaded, a file can be removed by selecting it and using the delete key.

• The "Override old class" option is used to specify whether the newer version of the classes present in the jars loaded need to take effect, if there are same classes in the already loaded jars.

Note: Even though the "Override old class" option is selected by default , it is preferable to uncheck it. It is mostly useful when the user wants to see the difference between the different versions of the same bean or when developing/testing a bean.

• You can also unload the jars which are loaded by default, by using the "Unload Jar" option in

the "File" menu.

Note: The jar files loaded automatically by default will be present in <Web NMS Home>/classes directory.

A Short Description of the different file formats

Jar File

This is the Java archive format. More information about jar files can be found in any JDK documentation. One important feature of the Bean Builder is that for a jar named abc.jar,

Page 79: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 78

another jar named abcBeanInfo.jar is also present in the same directory. On loading the jar abc.jar, the abcBeanInfo.jar is also loaded. This feature is to allow packaging of the classes necessary for design time such as BeanInfo classes, its icons,property editors etc. as a separate jar. This helps in reducing to a great extent the size of the jar needed for runtime.

List

This file provides an easy way of adding beans to the Component Palette. The beans can be specified as <bean names> in separate lines. If needed, the corresponding image icons for the beans can be specified using the construct <bean names>= <icon file name>. Note that the class files and icon files should be present in the already loaded jars or needs to be in the ClassPath. (e.g. SwingBeans.list present in the <Web NMS Home>/classes directory).

BXML files

This file provides an easy way of saving modified properties of beans (ie, customizing the beans to have some properties set to some default values without the need to create a new bean). Any Screen file <ScreenName>.config can be converted into a .bxml file by just renaming the file to <ScreenName>.bxml. Now load the bxml file using 'Load Jar' option and use the file.

Page 80: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 79

8.7.5 Using Screens as Beans Any screen created earlier can be used in the same project as a bean. In order to convert a screen into a bean, the minimum requirement is that the class file must be present under the classes directory of the project. If the screen has been built within the same project and compiled, it will already be present within the classes directory. The following are the steps involved in dropping the screens as beans:

• Switch to the "Project Classes" tab of the Component Palette. • The Combo Box lists the currently available screens in the Project. • Select the required screen from the Combo Box. • Click on the bean icon next to it. • Now click the mouse outside or inside the Draw Area as per requirement. • Now the screen is available as a bean in the Application.

Note: If a screen is modified and compiled after it has been dropped as a bean, the changes will automatically be updated in the dropped bean during runtime. However for design time updating, use the "Reload Bean" option in the Popup menu of the dropped bean.

Importing Classes

Importing classes from a different project built using Bean Builder

Any class available outside the current project can also be imported into the project.

The following are the steps involved in doing this. • Switch to the "Project Classes" tab of the Component Palette. • Now enter the class name in the editable combo box, which needs to be imported.

Any class that has 'public' access and 'zero' argument constructor (e.g. public MyClass()) can be dropped on to the screen. This should be a fully qualified name (without the .class extension).

• A 'Browse' option is also provided which enables to directly select the class to be imported.

• Click on the bean icon next to it. • Now click the mouse outside or inside the Draw Area as per requirement. • Now the imported class is available as a bean in the Application, provided you copy

the class file from the external project to the classes directory of the current project. All the related classes should also be copied.

Importing classes developed externally, not using Bean Builder

For Example, assuming that class MyClass with package MyPackage was built and compiled outside the Bean Builder. To drop this class into any of the screens in a project the following steps must be done.

• Copy the file MyClass.class into the directory <Project Directory>/classes/MyPackage. (Also all the class files required by MyClass have to be copied. If MyClass needs another class MyClassHelper of package HelperPackage, then file MyClassHelper.class needs to be copied into <Project Directory>/classes/HelperPackage directory.)

• Enter 'MyPackage.MyClass' in the combo box of the 'Project Classes' tab in the Component Palette.

• Click on the bean icon next to it. • Now click the mouse outside or inside the Draw Area as per requirement. • Now the imported class is available as a bean in the Application.

Page 81: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 80

Modifying Bean Properties After dropping the bean components in the screen, the look and the behavior of the beans can be modified by editing the property sheet of the beans. The property sheet can be invoked by double-clicking on the beans or choosing the property form from the Component pop-up menu. See Setting Bean Properties for more information.

Page 82: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 81

8.7.6 Setting Bean Properties Bean or Component Properties are set using Bean Property Form and it can be invoked by the following ways.

• Double click on the desired Bean. • Right click on the desired Bean to invoke the Bean Popup Menu; from the Popup menu select

the "Property Form" menu item. • Select the desired bean and choose the menu command "Properties -->Bean Properties" or

shortcut key F5. • Navigate to the Component Tree in the left and right click the desired bean to get the popup

menu, from the popup menu select the "Property Form" menu item. By default, Bean property sheet has two tabs - Properties and Custom code. It has a combo box which lists the property group names. These groups are helpful in sorting and displaying the desired properties in the properties tab. To know more about grouping of properties, refer this link.

Page 83: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 82

Properties A property is a characteristic which can be acessed using getter and setter methods. For example, consider a bean with the following methods.

public void setText(String s) { } public String getText() { }

This means that the Bean has a property 'Text' with the data type being a String. The properties that are exposed in the Property Form is dependent on the BeanInfo associated with the Bean. For example, if only some of the properties of a bean should be exposed in its Property form, they have to be specified in the BeanInfo. If there is no BeanInfo associated with the Bean, then all the properties will be listed in the Property Sheet. Each property will have an editor corresponding to the Data Type. For example - For a property of type String , a JTextField is provided as an editor. - For a property of type boolean, a ComboBox is provided as an editor. There is a default property editor for each and every type. But, when a Bean has got a BeanInfo associated with it and a specific editor has been set for a property, then that specific property editor will be made use to edit the property. To edit the property in the Property Form, double click on the editable field in the right side row corresponding to that property. Common Bean Properties

• Instance Name This identifies the instance of a Bean. By default this will be starting with the Component name and continued with a running number. This can be edited to any name as per need.

Note: The change in the instance name at a later time, will not be reflected in the connection code. This needs to be done manually. To avoid this, the change in the instance name needs to be implemented as soon as dropping a bean.

• Bounds This property enables to define the position and dimension for the Bean. The property value needs to be given in the order x- axis, y- axis, width and height.

• Padding Some of the Beans require padding space or require to be resized. Resizing of the beans is possible only in Flow or Border Layout, where the components are laid out to the preferred size by default. The padding space can be specified using this Property.

• Modifiers You can specify whether a Bean is static, final, etc. We can also give the Access Specifier along with these modifiers depending on how you would like to provide the permission for access. For example, you can give public static for specifying the bean is available in the whole of the Project and it is Static.

Page 84: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 83

• Initializer This Property provides you a way to instantiate the Bean using a non empty Constructor with some arguments. By default the initializer will be the empty constructor. For example there is a class myPackage.untitled with two constructors.

o untitled() o untitled(String)

Now to instantiate this class using the non empty constructor, the value for the Property Initializer should look like the following.

new myPackage.untitled("Hello");

Note: Empty constructor is mandatory for a class to be considered as a Bean.

Modified You may be interested in knowing the properties that have been modified from its default. Also need may arise, where the properties need to be set in a specific order and cancel altogether the newly set value for the property. These facilities are provided with the 'Modified' option. Clicking on the Modified button brings up a Dialog. This dialog shows the list of properties modified in that order.

• This order can be changed by using the "Up" and "Down" buttons. • The "Remove" button is used when a modified property has it to be cancelled.

Border feature This applies to beans that have Border as a property. You can now configure the Border Editor according to your choice, by clicking on the editable right side column of the "Border" property. The thickness of lines, the color of the border, the choice of border (like Title Border, Matte Border, Bevelled Border, etc) can be modified according to your choice. Advanced Property Editor The Advanced Property Editor helps to set the bean properties on runtime. This Editor suggests how the values for different properties can be customised. The Setting Advanced Properties topic gives more detailed explanation on the Advanced Property Editor. Indexed Property Editor The Indexed Property Editor is used to set the values for the indexed properties of the bean. Setting Indexed Properties topic for more detailed explanation on Indexed Property Editor. Custom code It may be required to make some API calls (that are not exposed as a Property) on the Bean and for easy understanding this code needs to be added along with the code generated for the Bean. Enter the code in the custom code area of the Property form.

Page 85: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 84

8.7.6.1 Setting Advanced Properties It is not mandatory that a property value for a Bean needs to be fixed. This may be dynamic and derived on runtime. The AdventNet Bean Builder provides the Advanced Property Editor (APE) to suggest how the values for a certain property can be obtained. The following are the ways a Bean can obtain value

• Fixed value as entered in the Editor. • From a parameter. • From a variable.

Advanced Property Editor (APE) To edit an Advanced property, select the property in the Property form and click on the editable right

side column. Now click on the respective button that appears in the corner to open the APE. The advanced property editor consists of a choice box, text field and text area. The combo box allows the user to choose from the following options - String, Project parameter or Variable/Expression. Based on the selection in the combo box, the value parameter or the variable name needs to be entered only in the text field and an appropriate syntax is added and displayed in the text area. The value on the text area will be the one actually being set on the component. The options are explained below.

• String String values can be entered directly either in the property editor or in the Advanced property editor. To set the String value using APE, choose the type "String" in the combo box of the APE and type the string in the adjacent text field. The text gets displayed in the text area. Pressing the 'Apply' button updates the value in the property editor.

• Project Parameter This section tells about the Project parameters and the corresponding values to be used in an Applet or Application. In the case of the Applet, these would be Applet parameters and the generated HTML Document will contain these parameter values. In the case of Application, these would be the command line arguments and the code required to parse these command line arguments are automatically generated. Applets can receive information from the HTML document. This information is set as parameters in the HTML files and can be received by the applet. The advanced property editor can be used to set such properties for the bean. Values can be set by choosing the "Project Parameters" from the choice box and entering the value in the adjacent text field. The text area displays the correct syntax - " \getParameter("") ". Pressing the "Apply" button updates the value in the source code.

o For example - assume a button component has to get the value of parameter named "example" from the HTML file.

o Select the APE of the "Text" property in the property form. o In the APE, select "Project parameters" in the combo box, type "example" in the adjacent

text field and press Enter. o In the text area above you can see the correct syntax that will go into the source code -

'\getParameter("example") '. o Pressing the "Apply" button updates the value. o Now select the "Project Properties" menu item from the Properties menu.

Page 86: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 85

o Set the value of the parameter "example" in the "Project Parameters" field, as example = hi.

o The value "hi" gets passed to the parameter, which can be verified by compiling and running the screen.

Note: If the "Text" field property of the component has already been set as a string with the same name "example", it will be displayed as a string in the APE. Change the type String as Project parameter.

• Variables The variables can be set by selecting the "Variables" from the choice box and entering the value in the text field. The text area displays the value with a back slash \ pre pending the value entered. Pressing the Apply button updates the information.

o For example - assume a Text field component should be set with a variable name say "input".

o Select the APE of the "Text" property in the property form. o In the APE, select "Variables" in the combo box, type "input" in the adjacent text field and

press Enter. o In the text area above you can see the correct syntax that will go into the source code -

"\input". o Pressing the "Apply" button updates the value. o Now give a value for the variable "input" in the source, say String input = "good". o The value "good" is set in the variable "input", which can be verified by compiling and

running the screen.

Page 87: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 86

8.7.6.2 Setting Indexed Properties

AdventNet Bean Builder uses Indexed Property Editor (IPE) to set values for the indexed properties of the bean. If the component requires more than one value, i.e an array of values, the IPE can be used to set such values. How to open IPE The Indexed Property editor will be available only for the Beans to which multiple values needs to be set. To edit an Indexed property, select the property in the Property form and click on the editable

right side column. Now click on the respective button that appears in the corner to open the IPE. Indexed Property Editor (IPE) The indexed property editor is similar to the Advanced property editor with two additions. It has an additional choice box and an additional text field. The first choice box lists the index values 0,1, 2.. etc. which can be used to choose the index number for the array. The first text field is used to enter the values for the corresponding array index. The non-editable second text field displays the current index value that has been chosen in the Index choice box. The second choice box is used to select the right type (String, Project parameters or Variables). The text area above all these fields shows the right syntax of the entered values for the corresponding index numbers. Setting Properties in IPE Setting Indexed property is similar to setting the advanced property. Choose the right type (String, Project parameters or Variables) in the text choice box, select the index in the index choice box, enter the value in the text field and press enter. The right syntax for the entered value will be displayed in the text area. Pressing the "Apply" button updates the information. If the "Close" button is pressed before the apply button the changes are discarded. Changing the String to Project parameter or Variable is done easily by changing the corresponding choice in the text choice box.

Page 88: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 87

8.7.6.3 Grouping of Properties The properties displayed in the Bean Property sheet can be categorized into different groups. By default, all the bean properties are displayed under 'All Properties' group and some of the extended bean properties are displayed under 'Extra Properties' group. Instance Name, Bounds, Padding, Modifiers, Initializer are the properties clubbed under 'Extra Properties'. How to create your own Group You can create your own group with the list of properties that has to be displayed in it. Consider the Property sheet of the bean 'HCellularGauge', which is taken as an example to explain grouping of properties throughout this topic. See the image below which shows the 'HCellularGauge' bean's property sheet.

Since 'All Properties' group is chosen, it displays all the properties of the bean 'HCellularGauge'. Suppose if you want to group all the 'Color' properties together, it can be done by the following steps:

• Create a XML file with the name of the bean for which the properties are going to be grouped. i.e. HCellularGaugeBeanGroup.xml for the Color properties

• Enter the new property group name and values corresponding to that group in the xml file. Let the property group name be 'colors' with values 'Background', 'Foreground', 'Cell Background', 'Border Color', 'Initial Color', 'Threshold Color1' and 'Threshold Color2'. See the xml file given below for your reference:

Page 89: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 88

<?xml version="1.0" encoding="UTF-8"?> <properties> <property name="colors" value="Background,Foreground,Cell Background,Border Color,Initial Color,Threshold Color1,Threshold Color2"/> <property name="otherProperties" value="Label Name,Label Font,Show Label,Scale Points,Scale Font,Show Scale,No Of Cells,Minimum Value,Maximum Value,Initial Value,Threshold Value1,Threshold Value2,Mark Threshold,"/> <property name="testgroup" value="Maximum Value,Initial Value,Threshold Value1,Threshold Value2,Mark Threshold,"/> <property name="testgroup3" value="Maximum Value"/> </properties>

Note: Any number entries for user-defined groups with their respective values can be entered in the file. In the above xml file, 'otherProperties', 'testgroup', 'testgroup3' represent other group entries with their corresponding values.

• Now update the Jar file in which the bean was present with the XML file. i.e. Update

'AdventNetUIBeanInfo.jar' with 'HCellularGaugeBeanGroup.xml' file such that it is present under the package structure. (AdventNetUIBeanInfo.jar:com/adventnet/beans/gauges/HCellularGaugeBeanGroup.xml)

Viewing the new group in Bean Property Sheet

• Load the updated Jar file into the beans palette using the File -->Load Jar option. • Drop the bean 'HCellularGauge' and you could see the new property 'colors' added to the

combo box. On choosing the group 'colors', it displays the sorted out color properties separately as shown below:

• On modifying a property under the group 'colors', it will be reflected in the corresponding property displayed under 'All Properties' group also.

Page 90: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 89

8.7.7 Default Beans in Bean Builder

8.7.7.1 AdventNet ProBeans The complete set of AdventNetProBeans can be broadly classified under the following categories.

• Editable Information Display Components • Non-Editable Information Display Components • Assembled Components

Editable Information Display Components This set of beans contains some editable information, shown in the beans. They also have a provision to allow or disallow the user to edit the value in the components. ProAdventNetTree: With this bean you can display any hierarchical data, vertically. By default, all the nodes except the root node is collapsed. You can copy and paste, cut and paste or drag and drop the tree nodes from one position to the other, in the tree. While renaming the nodes, validation is done, internally, to avoid duplication of node names. ProIntegerTextField: You can use this bean to show integer values. Option is provided for you to change the Radix of the text field to contain Hexadecimal, Octal or Decimal values. The basic validations for these radices are internally handled. You can also set the minimum and maximum values (range) that the bean must accept. ProIpAddressComponent: You can use this bean to show IP values. Also the basic required validations like checking for the presence of all the four values and the values to lie between 0 and 255 are handled internally. You can use asterisk (*) to show that it can be replaced with any value (e.g. in case of matching). While entering the values, typing dot (.) moves the focus to the next value. ProTable: You can display the data of any two dimensional array using this bean. The data from any database table can also be shown. ProDateTimeComponent: You can set the date and time in any desired format using this bean. Option to show only the date or only the time is also provided. Non-Editable Information Display Components This set of beans contains some Non-editable information, shown in the beans. ProTreeCombo: You can show a tree-like representation of the data inside a combo box. As the tree structure provides a wide scope of classifying the data, it is easier for the user to reach the desired data easily. ProProgressBar: You can show the progress of any operation by the movement of the bubble. This provides the feel about when the process is started and the bubble movement indicates that the operation is still in progress. ProStatusBar: You can display some message along with the progress bar. There is a provision to add a user component in the status bar. This is a very useful feature in any client application to show the current status of the process. ProToolBar: You can use this bean to display the toolbar in any client application. It can either be shown horizontal or vertical. The number of rows (in case of horizontal toolbar) and the number of columns (in case of vertical toolbar) can be configured. The size and the number of icons to be displayed in the toolbar can also be set. When the number of icons is not able to fit inside the toolbar,

Page 91: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 90

a control component is shown in the right edge of the toolbar. On clicking it the additional icons are shown in a drop down fashion. Each icon can also have a control component that can show a menu list (like the back button in the Internet explorer). Option to add a user component at the end of the toolbar is also provided. Assembled Components Each bean in this set is developed using a few other beans. i.e. they can be used to replace a complete set of beans for a particular function. ProListView: You can use this bean to build a complete client UI. It contains a browse panel and a table view to represent data in the UI. The table display area presents the data in a tabular form and the browse panel provides the controls for navigating through the data. Options for view-based sorting and data-based sorting of the data are provided. You can also render the cells, rows and columns with respect to colors, fonts, selection, painting, etc. Options to plug-in your own sorting and rendering mechanisms are allowed. The browse panel contains a total component to display the total number of rows in the output model. The ProRangeComponent which displays the currently shown set of data in the view. Next is the ProPageLength component which has a list of values in the form of a combo box adjacent to a label. Then is the set of buttons to navigate between the sets of information displayed in the current screen. Provision to add a user component in the browse panel is also made. ProSearchComponent: You can use this bean to filter out some data based on the given criteria. The regular options for searching data as provided in netscape are available here. You must write the complete implementation of this bean.

Page 92: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 91

8.7.7.2 UI Beans The following beans components are distributed as part of the Bean Builder. These components can be used for developing various applications. These belong to the AdventNetUIbeans jar.

• Active Icon • Dial • Digit • Digital Display • Horizontal Cellular Gauge • Image Button • Image Label • Led • LedPanel • Status Icon • Vertical Cellular Gauge

Page 93: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 92

8.7.7.2.1 Active Icon

Here is a bean that changes the image displayed depending on the range in which the value taken lies! For example, it can be determined that when it takes on values in the range 0-20, one particular image is displayed and when it takes on values in the range 20-40 another image is displayed and so on. These images are specified in the Property Form corresponding to the particular bean. Following are some of the main events that are generated by the Active Icon bean - component events, focus events, key events, mouse events, mouse motion events, property change and vetoable Change. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean to behave in a particular way once a certain event occurs. Following are some of the main properties associated with the Active Icon component.

Property

Description

Background The background color Layout Type of layout that is used in positioning the

Active Icon in a Container Constraints Indicates the relative positioning of the Active

Icon when it is placed inside a Container Green Triggers[] The list of trigger values for the color green.

Similarly, there are lists for other colors. Green Trigger Image The image that is displayed when green is

triggered. Similarly, there are Trigger Images for other colors.

The main method is the setIconRestult method which sets the value to be displayed on the ActiveIcon. How to use the Active Icon Bean The Active Icon bean can be used alongwith other beans like the JTextField(to display the value that is given in the text-field). The following code snippet explains how to instantiate and use some of the methods corresponding to the Active Icon.

com.adventnet.beans.images.ActiveIcon(); java.lang.String[] green_array = new java.lang.String[4]; green_array[0] = "25"; green_array[1]="50"; green_array[2]="75"; green_array[3]="100"; icon1.setGreenTriggers(green_array); icon1.setIconResult(100);

Page 94: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 93

The first line instantiates the Active Icon. The next five lines create an array of size 4 and sets the values to be 25, 50, 75 and 100. The next line sets this array to be the trigger values for the Green color. In the last line, the value is set to be "100" which is one of the trigger values for Green. So, the gif corresponding to green will be displayed. Now, using the Interaction Wizard, this can be connected to beans like the JTextField bean or the beans in the Snmp jar or other beans.

Page 95: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 94

8.7.7.2.2 Dial

Dial bean provides a visual display of the polled value. Depending on whether the Warning Level or the Critical Level is reached, the color of the Dial changes. The minimum value, maximum value, the warning level and critical values can be set. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean behave in a particular way once a certain event occurs. Following are some of the main properties associated with the Dial component.

Property

Description

Show Limits Whether to show Dial maximum and minimum

Is Half Dial Whether Half Dial or Full Dial. Warning Level The warning value. Critical Level The critical value Number of Markers Number of markers(max 200) The main method in the Dial bean is setDialPosition which sets the position of the Dial. How to use the Dial Bean The Dial bean can be used along with other beans like the JTextField(to display the value that is given in the text-field). The following code snippet explains how to instantiate and use some of the methods corresponding to the Dial Bean.

com.adventnet.beans.Dial dial1 = new com.adventnet.beans.Dial(); dial1.setDialMaximum(100); dial1.setDialMinimum(0); dial1.setCriticalColor(Color.red); dial1.setDialCritical(75); dial1.setDialPosition(80);

The first line does the instantiation. The second line sets the maximum value in the dial to be 100. The third line sets the minimum value in the dial to be 0. The fourth line sets the color corresponding to the critical value to be red.The fifth line sets the critical value to be 75. The sixth line sets the value displayed by the dial to be 80.

Page 96: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 95

8.7.7.2.3 Digit bean component

This bean gives a digital display of the value set. Only single digit value can be displayed. The foreground color , the color of on-segments and the color of the off-segments can be set. Following are some of the main events that are generated by the Digit bean component-the usual mouse events, mouse motion events, component events, focus events, key events, property Change, vetoable Change. An event which is specific to this bean is the digitChanged event which is invoked when the values displayed in the Digit bean are changed. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean to behave in a particular way once a certain event occurs. Following are some of the main properties associated with the Digit bean.

Property

Description

onColor To set the color of segments involved in the display

offColor To set the color of segments not involved in the display

The DigDisp bean in the AdventNet UI beans jar is similar to the Digit bean but it can display any number of digits whereas the Digit bean can display only single digit. The main method in the Digit bean is the setValue method which sets the value to be displayed on the bean. How to use the Digit Bean The Digit bean can be used alongwith other beans like the JTextField(to display the value that is given in the text-field). The following code-snippet explains how to the bean and how to use its methods.

com.adventnet.beans.Digit digit1 = new com.adventnet.beans.Digit(); digit1.setOnColor(Color.blue); digit1.setOffColor(Color.cyan); digit1.setValue(7);

The first line does the instantiation. The second line set the color of the segments that are used to display the value and the third line sets the color of the Off segment. The fifth line sets the value of the digit to be 7. Now, using the Interaction Wizard, this can be connected to other beans like the JTextField bean or some beans from the AdventNet Snmp jar or some other bean.

Page 97: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 96

8.7.7.2.4 Digital Display

Do you want to display the numeric value in a digital format? Look no further! Here is a bean that does just that. Set the number of digits the display can hold according to your preference. The foreground color of the bean and the color of the segments that are not currently in the display can be set. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean to behave in a particular way once a certain event occurs. Following are some of the main properties associated with the DigDisp bean.

Property

Description

NumericValue The numerical value displayed in the DigDisp component

NumDigits The number of digits in the DigDisp component.

OffColor The color of the segments that are not involved in the display

The bean that is related to the DigDisp bean is the Digit bean in the AdventNet UI beans jar. The difference is that the Digit bean cannot display more than one digit. The main method that is used in the DigDisp bean is the setNumericValue method which can be used to display a polled value. How to use the Digital Display bean The Digital Display bean can be used along with other beans like the JTextField(to display the value that is given in the text-field). The functionality provided by beans can be extended.It can be extended to display the value in binary or to any other base (less than or equal to 9). The following code snippets explain how to use the methods of the Digital Display. In the custom code portion of the Digital Display digdisp1, enter the following

digdisp1.setNumDigits(4); digdisp1.setForeground(Color.blue); digdisp1.setOffColor(Color.black); digdisp1.setNumericValue(1550);

The first line sets the number of digits to be 4. The second line sets the foreground color to be blue. The third line sets the color of the segments not involved in the display to be black. The fourth line sets the numeric value to be 1550.

Page 98: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 97

8.7.7.2.5 HCellular Gauge

Here is a bean that displays the polled value in a gauge format! The minimum value, the maximum value and the number of cells can be set. The background color and the foreground color can also be set using the Bean Property Form. The use of this bean is that it displays the value of a variable in the form of horizontal gauge display. Threshold values can be set. After the value crosses these threshold value, the color changes to the threshold color. Following are some of the main events generated by the HCellular Gauge component - the usual mouse events, mouse motion events, key events, focus events, property change events and vetoable change. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean to behave in a particular way once a certain event occurs. Following are some of the main properties associated with the HCellular Gauge component.

Property

Description

Show Label Shows Label if "True" Threshold Color1 Color displayed if the value crosses

ThresholdValue1 Threshold Color2 Color displayed if the value crosses

Threshold Value2 Threshold Value1 First Threshold Value Threshold Value 2 Second Threshold Value Apart from the HCellular Gauge bean , VCellular Gauge bean is also available with the only difference that they are vertically aligned. Otherwise, they perform the same function. The main method used is the setResult method that displays a polled value on the HCellular Gauge. How to use the HCellular Gauge Component The HCellular Gauge bean can be used alongwith other beans like the JTextField bean. The following code snippet explains how to instantiate the bean and use some of the methods pertaining to the bean.

com.adventnet.beans.gauges.HCellularGauge gauge1 = new com.adventnet.beans.gauges.HCellularGauge(); gauge1.setMinValue(0); gauge1.setMaxValue(200); gauge1.setScalePoints(3); gauge1.setBgColor(Color.blue);

Page 99: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 98

gauge1.setFgColor(Color.green); gauge1.setThresholdValue1(100); gauge1.setThresholdColor1(Color.red); gauge1.setResult(75);

The first line does the instantiation. The second and third line set the minimum and maximum values respectively. The fourth line sets the number of scale points. The fifth and sixth lines set the background and foreground colors to be blue and green respectively. The next two lines set the threshold value and color respectively. So, once the value crosses the threshold value the color shown is red. The last line sets the value to be displayed. Now, using the Interaction Wizard, these can be connected to the JTextField bean or beans from the AdventNet Snmp beans jar or to other beans.

Page 100: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 99

8.7.7.2.6 Image Button

The Image Button performs the functions of a JButton, the difference being that it has an image on it. This image is chosen by the user from the Property Form. The back ground and foreground colors can be set as desired. Following are some of the main events that are invoked by the Image Button component - the usual mouse events, mouse motion events, component events, focus events and key events. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean to behave in a particular way once a certain event occurs. Following are some of the main properties associated with the Image Button component.

Property

Description

Background Sets the background color for this Image Button Foreground Sets the foreground color for the Image Button Image File Sets the image file name that is loaded in the Image

Button The main method is the setup() which adds the mouse listener to the image button. How to use the Image Button The Image Button must be used along with other components like the JTextField. For example, you can create an application with a JTextField in it so that every time the Image Button is clicked, the value in the text-field gets increased by 1. You can choose an appropriate gif file that describes this action to be the image file. The following steps explain the use of the Image Button in the AdventNet Management Builder. Drop a Digital Display component from the AdventNet UI beans jar and an Image Button component into the Builder Screen Area. In the custom code section of the Digital Display component(digdisp1), write the following.

digdisp1.setNumDigits(8); digdisp1.setForeground(Color.blue); digdisp1.setOffColor(Color.black);

In the custom code section of the Image Button(button1) , write the following. Note that new.gif is the name of the image file that will appear on the Image Button.

button1.setImageName("new.gif"); ResultListener listener = new ResultListener() {

public void setResult(ResultEvent evt) { if (evt.getSource() == button1) {

digdisp1.setNumericValue(digdisp1.getNumericValue() + 1);

Page 101: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 100

} } } button1.addResultListener(listener);

The custom code in digdisp1 sets properties like the number of digits displayed, the foreground color and the color of the segments not used in display. The custom code in button1 sets the image file to be displayed on the Image Button. A result-listener is created. This listens to see if the source of the event is from button1. If so, the value displayed in digdisp1 is increased by 1.

Page 102: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 101

8.7.7.2.7 Image Label

The Image Label displays an image file based on the value a given variable takes. So, if you are polling an ObjectId in a distant host, the image can be changed depends on the value taken by the Object Id. The back ground color and the foreground color can be set by you. Following are some of the main events that are invoked by the Image Label component - the usual mouse events, mousemotion events, component events, key events, focus events, Property Change and vetoable Change. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean to behave in a particular way once a certain event occurs. Following are some of the main properties that are associated with the Image Label component

Property

Description

Constraints Indicates the relative position of the component when it is placed in a Container.

Layout Type of Layout that is used in the Container in which the component is placed

Image File Name of the image file to be displayed The main method is setImage which sets the image to be displayed on the Image Label. How to use the Image Label This component is used in dynamic loading of images based on the values set. It can also be used as a dynamic label with the text getting updated based on the values set. The following code-snippet explains the instantiation and the use of some of the methods.

com.adventnet.beans.images.ImageLabel label1 = new com.adventnet.beans.images.ImageLabel(); label1.setFgColor(Color.black); label1.setBgColor(Color.blue); label1.setImageName("images/ethernet.gif");

The first line does the instantiation . The second line sets the foreground color to be black. The third line sets the background color to be blue. The last line sets the image shown to be the needed gif.

Page 103: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 102

8.7.7.2.8 Led

Here is a bean component that changes its color depending on the threshold value crossed. So, depending on the seriousness, whether the value is at critical level, danger level or at warning level, the color of the Led changes. You can set the background and the foreground colors. You can set the different Threshold values for the different Threshold colors. You can also decide the number of different states. Following are some of the main events that are invoked by the Led component - component events, focus events, key events, mouse events, mouse motion events, property change and vetoable Change. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean to behave in a particular way once a certain event occurs. Following are some of the main properties associated with the Led component.

Property

Description

NoOfStates Sets the number of Threshold states Threshold Color1-7 Sets the different colors for the various threshold values. Threshold Label1-7 Sets the label names for the various threshold values. Threshold Value1-7 Sets the various threshold values for the component Show Value Sets whether to show the value or not. The main method is the setResult method which sets the Led display to be the color pertaining to a polled value. How to Use the Led Bean The Led bean can be used alongwith other beans like the JTextField(to display the value that is given in the text-field). The following code snippet explains how to instantiate and use some of the methods corresponding to the Led.

com.adventnet.beans.Led led1 = new com.adventnet.beans.Led(); led1.setBgColor(Color.black); led1.setNumberOfStates(3); led1.setThresholdColor1(Color.red); led1.setThresholdColor2(Color.blue);

Page 104: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 103

led1.setThresholdColor3(Color.green); led1.setThresholdValue1(10); led1.setThresholdValue(20); led1.setThresholdValue(30); led1.setResult(20);

The first line instantiates the Led. The second line sets the background color to be black. The third line sets the number of states to be three. The fourth , fifth and sixth lines set the threshold colors to be red, blue and green respectively. The seventh , eighth and ninth lines set the threshold values to be 10, 20 and 30 respectively. The last line sets the value displayed by Led to be 20. So , the color displayed should be blue. Now, using the Interaction Wizard, this can be connected to beans like the JTextField bean or the beans in the Snmp jar or other beans.

Page 105: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 104

8.7.7.2.9 Led Panel Here is a bean component which consists of a set of three LED's. The default color as well as the blinking color of each LED can be configured. The radius of the LED can also be set as desired. The time interval during which the LED blinks can be set as desired. Following are some of the main properties associated with Led Panel bean.

Property

Description

Time Delay Time interval for LED to blink. Set Color To Blink Index of LED required to blink. Led Radius Radius of LED. Led Blink Color1 Color of LED1 when it is blinking. Led Color1 Default Color of LED1.

How to Use the LedPanel Bean The LedPanel bean can be used alongwith other beans like the JTextField(to display the value that is given in the text-field). The following code snippet explains how to instantiate and use some of the methods corresponding to the LedPanel.

com.adventnet.beans.LedPanel ledPanel = new com.adventnet.beans.LedPanel(); ledPanel.setLedRadius(35); ledPanel.setLedColor1(java.awt.Color.pink); ledPanel.setLedBlinkColor1(java.awt.Color.blue); ledPanel.setTimeDelay(1000); ledPanel.setColorToBlink(1);//The value must be either 0 , 1 or 2

The first line instantiates the LedPanel bean. Second line sets the radius of the three LEDs. The third line sets the color of the first LED under normal condition. Fourth line sets the color of the first LED while blinking. Fifth line sets the time delay with which the LED blinks. Sixth line sets the index of the LED which has to blink.

Page 106: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 105

8.7.7.2.10 Status Icon

Concerned about finding a simple,convenient way to decide if the values taken by a certain variable are in the desired range? This bean does it! Green Triggers[]: The values for which the color displayed must be green can be set here. Red Triggers[]:The values for which the color displayed must be red can be set here. Yellow Triggers[]:The values for which the color displayed must be yellow can be set here. Cyan Triggers[]: The values for which the color displayed must be cyan can be set here. Orange Triggers[]:The values for which the color displayed must be orange can be set here. Gray Triggers[]:The values for which the color displayed must be gray can be set here. This component has different trigger values for different colors i.e. it changes its color the moment a trigger value is reached. The use of this bean is that it can be used to give a visual indicator of the range of values taken by, say, the polled value when it is connected to a poller component. So, for example, its properties can be set to show green when the polled value is between 0-20, red when the polled value is between 20-40, yellow when the polled value is between 40-60, cyan when the polled value is between 60-80 and so on. Following are some of the main events generated by the Status Icon component - Component events, focus events, key events, mouse events, mousemotion events, property change and vetoable change. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean to behave in a particular way once a certain event occurs. Following are some of the main properties that are associated with the Status Icon component.

Property

Description

Background The background color for the Status Icon component

Green Triggers[] A list of values that are trigger values for green color. Similar lists exist for other colors

Constraints Indicates the relative positioning of the Status Icon when it is placed inside a Container

The Active Icon performs a related task. While the StatusIcon changes the color depending on trigger values, the Active Icon changes the image displayed depending on the trigger values. The main method is the setIconResult that sets the background color to be the one pertaining to a polled value.

Page 107: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 106

How to use the Status Icon bean The Status Icon bean can be used along with other beans like the JTextField bean. The following code snippet explains how to instantiate the bean and set the trigger values for a particular color, cyan.

com.adventnet.beans.images.StatusIcon StatusIcon1 = new com.adventnet.beans.images.StatusIcon(); java.lang.String[] cyan_array = new java.lang.String[4]; cyan_array[0] = "2"; cyan_array[1]="4"; cyan_array[2]="6"; cyan_array[3]="8"; StatusIcon1.setCyanTriggers(cyan_array); StatusIcon1.setIconResult(4);

The first line instantiates the StatusIcon. The second line creates an array of strings of size 4. The next four lines set the four array values. The next line sets the values in this array to be the trigger values for the color Cyan. The last line sets the value to be "4". Now, using the Interaction Wizard, these can be connected to the JTextField bean or beans from the AdventNet Snmp beans jar or to other beans.

Page 108: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 107

8.7.7.2.11 VCellular Gauge

Need to see a numeric value displayed in gauge format? This bean solves your problem. You can set the maximum value, the minimum value, the number of cells to be of your own choice. You can also choose the foreground color, the background color, the cell color according to your preference. Following are some of the main events invoked by the VCellularGauge component - the usual mouse events, mouse motion events, component events, key events, focus events, propertyChange and vetoableChange. These are useful if you want to write event Listeners or use the Interaction Wizard to get another bean to behave in a particular way once a certain event occurs. Following are some of the main properties associated with the VCellularGauge component.

Property

Description

Scale Points Sets the number of points on the scale of the VCellularGauge

ThresholdValue1 Sets the threshold value beyond which the color changes to the Threshold Color1

ThresholdValue2 Sets the threshold value beyond which the color changes to the Threshold Color2

NoOfCells Sets the number of cells in the VCellularGauge

The VCellularGauge is related to the HCellular Gauge. While one offers a display in the form of a vertical positioning, the other offers a display in the form of a horizontal positioning. The main method is the setResult method that displays the polled value on the VCellular Gauge. How to use the VCellular Gauge bean The VCellularGauge bean can be used alongwith other beans like the JTextField(to display the value that is given in the text-field). The following code snippet explains how to instantiate and use the methods of the VCellularGauge.

com.adventnet.beans.gauges.HCellularGauge gauge1 = new com.adventnet.beans.gauges.HCellularGauge(); gauge1.setMinValue(0);

Page 109: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 108

gauge1.setMaxValue(200); gauge1.setScalePoints(3); gauge1.setBgColor(Color.blue); gauge1.setFgColor(Color.green); gauge1.setThresholdValue1(100); gauge1.setThresholdColor1(Color.red); gauge1.setResult(75);

The first line does the instantiation. The second and third lines set the maximum and minimum values. The fourth line sets the number of scale points to be 3. The fifth and sixth lines set the background and foreground colors. The seventh line sets the threshold value to be 100. The eighth value sets the threshold color to be red. The last line sets the value displayed to be 75. Now, using the Interaction Wizard, these can be connected to the JTextField bean or beans from the AdventNet Snmp beans jar or to other beans.

Page 110: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 109

8.7.7.3 Util Beans The following are the beans available in the AdventNetUtils.jar.

• AdventNetPoller • AdventNetTimer • Calendar • CardPanel • ColorComboBox • Combiner • DecimalSpinControl • DecimalTextField • Export Table • JDBCAdapter • MaxMinThresholdAlerter • Net Address Field • NumericSpinControl • Print Table • Sort Table • ThresholdAlerter • Time

Page 111: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 110

8.7.7.3.1 AdventNetPoller This performs a given action mentioned in the actionPerformed method periodically with time period equal to the pollTime. While the AdventNetTimer uses the AwtThread, the AdventNetPoller(Utils Jar) runs in a separate thread. The main properties associated with this bean are as follows.

Property

Description

Debug Is set to be true/false. If true, the command is printed every time

Command This is displayed every time that the actionPerformed method is called

pollTime The time interval between two successive polling in seconds

pollStatus This is set to be true/false. If true, the polling is done.

The main methods that are associated with this bean are - getCommand, getDebug, getPollTime, getPollStatus, setCommand, setDebug, setPollTime, setPollStatus. How to use the bean This bean can be dropped in the section meant for invisible beans and connected to a bean from the AdventNet UI beans jar. The following code-snippet explains how to use some of the methods of the AdventNetPoller.

com.adventnet.beans.utilbeans.AdventNetPoller poller1 = new com.adventnet.beans.utilbeans.AdventNetPoller(); poller.setPollTime(500); poller.setPollStatus(true);

The first line does the instantiation. The second line sets the poll time to be 500 seconds. The third line sets the pollStatus to be true , thereby enabling the polling.

Page 112: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 111

8.7.7.3.2 AdventNet Timer This is used to perform a given action mentioned in the actionPerformed method periodically. The time interval between two successive actions is specified in the "delay" property. The AdventNetTimer uses the AwtThread while the AdventNetPoller(AdventNetUtils Jar) runs in a separate thread. The main event associated with the AdventNetTimer is the action Event. The main properties that are associated with the AdventNetTimer are as follows.

Property

Description

Delay

This represents the time period after which the concerned action is performed

InitialDelay

This represents the initial delay in performing the action

Command

This represents the command that is printed every time the action is performed

Debug

This can be set to true or false. If true, the command is printed every time the action is performed

The main methods that are associated with this bean are setDelay, setInitialDelay, setCommand,setDebug, isRunning, getDelay, getInitialDelay, getCommand and getDebug. How to use the bean This bean can be dropped in the section meant for invisible beans. This can be used by connecting to an AdventNet UI bean.

com.adventnet.beans.utilbeans.AdventNetTimer timer1 = new com.adventnet.beans.utilbeans.AdventNetTimer(); timer.setCommand("Running"); timer.setDelay(500); timer.setDebug(true); timer.setRunning(true);

The first line does the instantiation. The second line sets the command. The third line sets the delay. The fourth line sets debug to be true. The fifth line ensures the timer is running.

Page 113: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 112

8.7.7.3.3 Calendar

This bean is used to display the date in MM:DD:YY format. It has a timer that can be set so that the date is updated every day at 12:00AM. Following are some of the main events that are associated with the Calendar bean - action Event, focus events, valueChanged Event. The main properties are as given below.

Property

Description

StartCalendar This takes on values of True/False depending on whether the Calendar is to be started or not.

The main methods that are used by this bean are as follows - setMonth, setYear, setDay, setStartCalendar and isRunning. How to use the Calendar bean It can be used to display the current date. It can be also used along with the SnmpPoller. The following code-snippet explains how to instantiate the bean and use some of its methods.

com.adventnet.beans.utilbeans.Calendar calendar1 = new com.adventnet.beans.utilbeans.Calendar(); calendar1.setDay(5); calendar1.setMonth(2); calendar1.setYear(10); calendar1.setStartCalendar(true);

Page 114: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 113

8.7.7.3.4 Card Panel Bean The Card Panel is used to display different cards. It can be used along with some of the other beans to display different cards simultaneously. The main properties that are associated with the Card Panel bean are as follows.

Property

Description

CardAndClassNames

This is a list of the cards and the class names for each card

The main methods that are associated with the Card Panel bean are getSelectedCard, showCard, getFirstCardName, getNextCardName, getPreviousCardName, getCardComponent and getClassNames. How to use the bean This bean is used by specifying different cardandclassNames in the property form. It can be used along with AdventNet Tree to display the cards corresponding to the different nodes in the tree. The following code-snippet explains some of the methods that are used in the Card Panel.

com.adventnet.beans.panels.CardPanel cardpanel1 = new com.adventnet.beans.panels.CardPanel(); String names[]= {"card1", "card2", "card3"}; String classes[] ={ "class1", "class2", "class3"}; cardpanel1.setCardNames(names); cardpanel1.setClassNames(classes); cardpanel1.showCard("card2");

The first line does the instantiation. The second and third lines created the arrays of names and classes respectively. The fourth line sets the names of the cards. The fifth line sets the names of the classes. The last line ensures that the second card is displayed.

Page 115: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 114

8.7.7.3.5 Color ComboBox This bean is used to display the different items in the combobox in different colors. This is achieved by setting the background and the foreground colors for these items as shown below.

The main events that are associated with this bean are action event, item event , mouse events and mousemotion events. The main properties that are associated with this bean are as follows.

Property

Description

Foreground Color This sets the foreground color for the item. Background Color This sets the background color for the item. Items list This sets the list of items that are displayed in the

combobox. Selected Index This gives the index of the item that is selected.

The main methods that are used by this bean are - setBackrgoundColors, setForegroundColors, addItem, setSelectedItem and removeItem . How to use this bean This bean can be used along with the TrapParser bean to show the severity of a trap. The following code-snippet explains how to use some of the methods of the ColorCombo Box.

com.adventnet.swing.ColorComboBox box1 = new com.adventnet.swing.ColorComboBox(); Color col[] = { Color.blue, Color.red, Color.green}; box1.addItem(new String("Item1"); box1.addItem(new String("Item2"); box1.addItem(new String("Item3"); box1.setForegroundColors(col);

The first line does the instantiation. The second line sets the colors in the array. The next three lines add 3 items to the ColorComboBox and the last line sets the Foreground colors.

Page 116: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 115

8.7.7.3.6 Combiner This is used to pass objects and values between screens. The values are passed to another combiner of the same group. The event associated with this bean is the Combiner event. The properties associated with this bean are as follows.

Property

Description

Group This refers to the group in which the Combiner is.

InitialValue This sets the initial value to the Combiner.

The main methods are setGroup, setInitialValue, passObject and getOriginalObject. How to use the Combiner bean The combiner bean can be used to pass objects between screens. passObject and getOriginalObject are the two methods that are useful for this. passObject method is used to pass the Object (say, a string) and getOriginalObject is the method that is used to get the object that is passed. Thus, for example, this can be used to pass the value of a String from one screen to another. The following code snippet explains some of the main methods used in the Combiner bean.

com.adventnet.swing.combiner combiner1 = new com.adventnet.swing.combiner(); combiner1.setGroup("G1"); combiner1.passObject(new String("Hello World"));

The first line does the instantiation. The second line sets the Group in which the combiner is present to be G1. The third line passes a String object "Hello World".

Page 117: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 116

8.7.7.3.7 Decimal Spin Control

The DecimalSpinControl bean can be used to display decimal numbers in a text-field. The values can be increased or decreased by using the Uparrow and DownArrow buttons at the right end of the text-field. The main events that are associated with this are actionEvent and focusEvent. The main properties that are associated with this bean are as follows.

Property

Description

Maximum value This is the maximum value that can be displayed in the bean.

Minimum value This is the minimum value that can be displayed in the bean.

Step This is the amount by which the value displayed in the bean can be increased or decreased.

The main methods that are associated with this bean are - setMin, setMax, getMin, getMax, getStep and setStep. How to use the Decimal Spin Control bean The following code snippet explains how to use some of the methods of the beans.

com.adventnet.beans.utilbeans.DecimalSpinControl decspin1 = new com.adventnet.beans.utilbeans.DecimalSpinControl(); decspin1.setMax(95.0); decspin1.setMin(5.0); decspin1.setStep(4.5); decspin1.setValue(14.0);

The first step does the instantiation. The second and third lines set the maximum and minimum respectively. The fourth line sets the step. The last line sets the value to be displayed in the bean.

Page 118: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 117

8.7.7.3.8 Decimal Text Field

This is a text field that is used to display decimal values. The main events that are associated with this bean are action Event , focus event and key event. The main properties for this bean are as follows.

Property

Description

Maximum value

This represents the maximum value that can be represented in the DecimalTextField

Minimum value

This represents the minimum value that can be represented in the DecimalTextField

Text

This is for entering decimal value only

The main methods for this bean are setMaxValue, getMaxValue, setMinValue, getMinValue, setText and getText. How to use the DecimalTextField bean The following code-snippet explains how to use the bean.

com.adventnet.beans.text.DecimalTextField field1 = new com.adventnet.beans.text.DecimalTextField(); field1.setMaxValue(100); field1.setMinValue field1.setText("10");

The first line does the instantiation. The second line sets the maximum value to be displayed. The third line sets the minimum value to be displayed. The fourth line sets the value to be displayed.

Page 119: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 118

8.7.7.3.9 Export Table Dumps Contents of Table into file, can be used only for Application. The important methods are:

Method

Description

exportTable(table) dumps the contents of the table in a file

How To use this bean

ExportTable eT = new ExportTable(); JTable myTable = new JTable(); eT.exportTable(eT);

Page 120: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 119

8.7.7.3.10 JDBC Adapter This bean can be used if there is a database and the user needs to query it. The main event that is associated with this bean is the TableChanged event. The main properties that are associated with this bean are as follows.

Property

Description

urlList[] The url of the database driverName The name of the driver userName The user name using which the database is accessed. password The password for the corresponding user name.

The main method that are associated with this bean is executeQuery. How to use the bean This bean is used if there is a database and the user needs to query it. He has to specify drivername, username and password and url for the database. One should first configure the JDBCAdapter component of the AdventNet Management Builder. This can be done as follows.

1. Drop the JDBCAdapter component from the AdventnetUtils jar on to the Builders design Screen. Double click on it to open its property form.

2. Fill in the DriverName property as the String "sun.jdbc.odbc.JdbcOdbcDriver" 3. Fill in the url property as the string "jdbc:odbc:<odbc name of your SQLServer Database>" 4. Fill in the userName and Password property as the userName and password you have given

for your SQL-Server Database. After having configured the JDBCAdapter a typical query application can be built with it , by following these steps.

1. Drop a JTextField and ScrollJTable component from the SwingBeans jar. 2. Make a Connection from the JText Field to the JDBCAdapter component via the action event.

In the interaction wizard that comes up, a function called public void actionPerformed(java.awt.event.ActionEvent arg0) will come up . Make this function look like the following. public void actionPerformed(java.awt.event.ActionEvent arg0) { javax.swing.JTextField tf = (javax.swing.JTextField) arg0.getSource(); target.executeQuery(tf.getText()); }

3. Make a connection from the JDBCAdapter component to the ScrollJTable component via the tableModel event. The interaction wizard comes up with the function public void tableChanged(javax.swing.event.TableModelEvent arg0) Make it look like the following. public void tableChanged(javax.swing.event.TableModelEvent arg0) { target.setModel((javax.swing.table.TableModel) arg0.getSource()); }

Now an Sql query application is successfully created. You can now type any Sql query in the JTextField and get the result set represented in the ScrollJTable Component.

Page 121: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 120

8.7.7.3.11 MaxMinThresholdAlerter Bean which fires events to listeners when threshold level exceeds maximum or minimum threshold levels. The main properties are as follows.

Property

Description

Threshold Behaviour

Fire when state changed - fires only once when value is above Max threshold or value comes back to normal or once when below Min threshold. Fire Always - fires always when above Max threshold or below Min threshold and once when back to normal from below min or above max.

To use this , instantiate and set its properties.

MaxMinThresholdAlerter ta = new MaxMinThresholdAlerter(); ta.setThresholdBehaviour(ta.FIRE_WHEN_STATE_CHANGED); ta.setMaxLevel(10000); ta.setMinLevel(1000); ta.setThresholdLevel(<long>); // set the long value using polling through snmp propery.

Then register the listeners which will handle the Threshold events that are generated by the bean.

public void thresholdReached( com.adventnet.beans.threshold.ThresholdEvent arg0) { System.out.println("Above or below threshold" + arg0.getLongResult()); }

Page 122: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 121

8.7.7.3.12 Net Address Field Field used for displaying string of any form of string with seperator chars, especially for showing mac address of form <xx:xx:xx:xx:xx:xx......> The main properties of the bean are.

Property

Description

Text this sets the text to the fields textFields this sets the number of fields that are to be displayed seperated by the

separator chars seperator the separator char to be displayed between the fields validEntries the entries which should be accepted by the fields

To use this bean, to display the text "00 50 bf 0a 43 5a".

com.adventnet.beans.text.NetAddressField field1 = new com.adventnet.beans.text.NetAddressField (); field1.setTextFields(6); field1.setSeperator(":"); field1.setValidEntries(new String[]{"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}); field1.setText("00 50 bf 0a 43 5a");

Page 123: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 122

8.7.7.3.13 Numeric Spin Control

The NumericSpinControl bean can be used to display a numeric value. The value displayed by the bean can be increased or decreased by using the buttons at the right end of the bean. The main events that are associated with the bean are the action Event and the focus Event. The main properties that are associated with the bean are as follows.

Property

Description

Maximum Value

This represents the maximum value that can be displayed in the field

Minimum Value

This represents the minimum value that can be displayed in the field

Step

This represents the amount by which the value in the field can be increased or decreased.

The main methods that are associated with the bean are - setMin, setMax, getMin, getMax, getStep and setStep. How to use the NumericSpinControl bean The following code-snippet explains how to use some methods of the NumericSpinControl bean.

com.adventnet.beans.utilbeans.NumericSpinControl numspin1 = new com.adventnet.beans.utilbeans.NumericSpinControl(); numspin1.setMax(100); numspin1.setMin(5); numspin1.setStep(2); numspin1.setValue(10);

The first line does the instantiation. The second line sets the maximum value. The third line sets the minimum value . The fourth line sets the size of the step. The last line sets the value that is displayed in the bean.

Page 124: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 123

8.7.7.3.14 Print Table Extension of JTable, supports printing of Table. This works only for Applications. The important methods in this table are.

Method Description setPrintTitle this title will be used for all pages when printed printTable this method prints the table.

To use this, instantiate the bean.

PrintTable ta = new PrintTable(); If you want to print the table on the click of a button , add action listener for the button.

btn.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { ta.setPrintTitle("Test Page"); ta.printTable(); } } );

Page 125: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 124

8.7.7.3.15 Sort Table Table which can be used for sorting, sorting will work only when the model that is set to the table , implements SortInterface, or can use the SortTableModel , that comes in AdventNetUtils.jar package name com.adventnet.beans.table.SortTableModel. Follow the steps below to use the table.

SortTableModel sModel = new SortTableModel(<data object array>,<column names object array>) SortTable sTable = new SortTable(); sTable.setModel(sModel);

Now clicking on the Header of columns sorts the table columns.

Page 126: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 125

8.7.7.3.16 Threshold Alerter Bean which fires events to listeners when threshold levels are exceeded. The main properties are as follows.

Property Description Threshold Behaviour

Fire when state changed - fires only once when value is above threshold or value comes back to normal Fire Always - fires always when above threshold and once when back to normal

To use this , instantiate and set its properties.

ThresholdAlerter ta = new ThresholdAlerter(); ta.setThresholdBehaviour(ta.FIRE_WHEN_STATE_CHANGED); ta.setThresholdFlag(<boolean>); // set the flag to true when threshold condition exceeds, false when below threshold.

Then register the listeners which will handle the Threshold events that are generated by the bean.

public void thresholdReached( com.adventnet.beans.threshold.ThresholdEvent arg0) { if(arg0.getBooleanResult()) { System.out.println("Above threshold"); } else { System.out.println("Below threshold"); } }

Page 127: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 126

8.7.7.3.17 Time bean

The Time bean is used to display the time in hours, minutes and seconds. The main events that are associated with the bean are value Changed event, action Event and focus event. The main properties that are associated with the bean are as follows.

Property Description Time This represents the time in milliseconds from Jan 1,1970 startTimer This takes on values True/False depending on whether the timer is to be

started or not

The main methods that are associated with this bean are setStartTimer, setHour, setMinute, setSecond and isRunning. How to use the bean It can be used along with SnmpPoller(in the AdventNetSnmp jar) to perform a certain action at a given time. The following code-snippet explains how to use the bean.

com.adventnet.beans.utilbeans.Time time1 = new com.adventnet.beans.utilbeans.Time(); time1.setHour(10); time1.setMinute(40); time1.setSecond(30); time1.setStartTimer(true);

The first line does the instantiation. The second line sets the hour to be 10. The third line and the fourth line set the minute and second respectively. The last line starts the timer.

Page 128: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 127

8.8. Laying out Components Layout plays an important role in designing User Interface for Applications. The layout support in AdventNet Bean Builder provides you the faster and efficient development of UI. Each container either has a layout manager or uses absolute positioning. All JPanel objects are initialized to use a Flow Layout. Content panes (the main containers in JApplet, JDialog, and JFrame objects) use Border Layout, by default. The following Layouts are supported by the draw area provided with AdventNet Bean Builder.

• Null Layout • Flow Layout • Border Layout • Grid Layout • Grid Bag Layout • Card Layout

Viewing the Current Layout

• Select the Screen/Component for which you would like to view the Layout. • Right click on the Screen/Component. This brings up a Popup menu. • From the Popup menu, select the menu item Layout. This brings up a sub popup menu listing

all the possible layouts. Each Layout menu item has a RadioButton associated with it, with one selected at any point of time.

• The selected RadioButton indicates that the Layout corresponding to the selection is the current layout for the Screen/Component.

Setting/Changing the Layout

• Select the Screen/Component for which you would like to Set/Change the layout. • Right click on the Screen/Component. This brings up a Popup menu. • From the Popup menu, select the menu item Layout. This brings up a sub popup menu listing

all the possible layouts. Each Layout menu item has a RadioButton associated with it, with one selected at any point of time.

• Select the RadioButton corresponding to the Layout you would like to set on the Screen/Component.

Setting Layout Properties

• Select the Screen/Component to set the layout properties of the components inside the Screen/Component.

• Right click on the Screen/Component. This brings up a Popup menu. • Select the Layout Properties menu item. • This invokes the Dialog which is based on the current Layout set for the Screen/Component.

Resizing in Layout Resizing is not allowed for all the layouts, i.e, only in some specific layouts, components are allowed to resize. The following are the layouts in which the resizing is allowed:

• Null Layout (or) Position Layout. • Border Layout. • Flow Layout.

Page 129: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 128

8.8.1 Using Null Layout If a container holds components whose size isn't affected by the container's size or by font and look-and-feel changes, then absolute positioning might make sense. Desktop panes which contain internal frames belong to this category. The size and position of internal frames doesn't depend directly on the desktop pane's size. The programmer determines the initial size and placement of internal frames within the desktop pane and then the user can move or resize the frames. A layout manager is unnecessary in this situation. In the Null Layout, the beans can be placed anywhere. The beans are simply dropped into the draw area and the beans stay where they are dropped. The default layout of a screen is Null Layout. Resizing in Null/Position Layout: In Position layout/ Null layout (which is the default Layout set in the Draw Area), you will be able to resize the component with the help of the mouse and also you can set the bounds in the property form. Aligning Beans in Null Layout The bean components in a screen can be aligned by using the Alignment feature. This provides an accurate way of aligning, setting same width/height and setting the spacing between the selected components. By using this feature, the UI can be made more uniform and this is applicable only for components in a Null Layout. This will be explained by the following example. Drop a few beans into the Bean Builder draw area. Click on one of the beans. This bean gets selected. Press the "Shift" key and click on the next bean. This bean also gets selected. Similarly, select the other beans that have to be aligned. Now, right-click and a pop-up menu with different menu-items appear as shown in the picture below.

• You can use the "Right Align", "Left Align", "Top Align", "Bottom Align" and "Center Align" to set your desired positions.

Page 130: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 129

• Use the "Horizontal Spacing" and "Vertical Spacing"options to set the space between these beans.

• By using the "Same Width" and "Same Height" options, you can set equal width/height for the beans.

Note: In case of multiple bean selection, all the menus in the popup list will be enabled only when your first selected bean lies in the draw area.

Page 131: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 130

8.8.2 Using Flow Layout Flow Layout is the default layout manager for every JPanel. It simply lays out components from left to right, starting new rows if necessary.

• Flow Layout puts components in a row, sized at their preferred size. • If the horizontal space in the container is too small to put all the components in one row, Flow

Layout uses multiple rows. • Within each row, components are centered (the default), left aligned, or right aligned as

specified in the LayoutProperties of Flow Layout. • The horizontal gap and vertical gap specify the number of pixels to be put between

components. • If you don't specify a gap value, Flow Layout uses 5 as the default gap value.

Using Bean Builder, the Components can be placed directly to the Container or moved around to change the position. The Vertical and Horizontal Gap can be specified using the Layout Properties Dialog. How to use it

• Create a new screen. Click on the screen and right click on it to open a pop-up menu. • Choose Flow Layout from the Layout and click on it. The components will now be arranged

according to Flow Layout. • Select the Container for which the Flow Layout is set and right click on Layout Properties from

the pop-up menu to open up the "Flow Layout Constraints" as shown at the bottom of the page.

• Alignment (center, left and right) can be set here. • The Horizontal and Vertical gap can also be set here (by default it is 5). • A flow layout lets each component assume its natural size. So resizing can be done for this

layout. Resizing in FlowLayout The components can be directly resized by dragging it using mouse and also by setting bounds in property sheet. Components can be resized to its minimum size and not below it. If the bounds set are less than the minimum size it reverts back to its minimum size. FlowLayout properties

The layoutProperties in FlowLayout allows us to set the HGap , VGap and alignment properties.

• HGap - horizontal spacing between components. • VGap - vertical spacing between components. • Alignments - Align all the components in center, left or right side of the container screen.

Page 132: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 131

Aligning Beans in FlowLayout The beans in this layout are aligned one after the other in a sequential order. The alignment and spacing properties like RightAlign, Leftalign, TopAlign, VerticalSpacing, etc. are not applicable for this layout. Therefore in this layout, only two options are enabled when you right click on the multiple selected beans. They are Same Width and Same Height. Using these options you can you can fix the same width or height for a set of beans.

Page 133: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 132

8.8.3 Using Border Layout Border Layout is the default layout manager for every content pane. The content pane is the main container in all frames, applets, and dialogs.

• A Border Layout has five areas: north, south, east, west, and center. • If you enlarge the window, the center area gets as much of the available space as possible. • The other areas expand only as much as necessary to fill the available space. • By default, a Border Layout creates no gap between the components it manages. The Gap for

the components need to be explicitly given using the HGap and VGap properties. • The horizontal gap and vertical gap specify the number of pixels to be put between

components. The components are laid out according to their preferred sizes and the constraints of the container's size. The NORTH and SOUTH components are stretched horizontally; the EAST and WEST components are stretched vertically; the CENTER components fill the rest of space. Using Bean Builder, the components can be placed in one of the required area by visually dragging/moving and placing them on the particular area (Use the Status Bar, which indicates the mouse position). Alternately the components can be arranged using the Layout Properties , with the container Layout set as Border Layout. Also using the Layout Properties Dialog, the HGap and VGap can be specified. How to use it

• Create a new screen in your project. Click on the screen draw area and right click to view the pop-up menu.

• Choose Border Layout from the Layout and click on it. This sets the Border Layout for the container.

• The components can be dropped in the desired area (i.e. north, south,etc..) . The position where they are going to be dropped is indicated in the status bar.

Note: When adding a component to a container that uses Border Layout, make sure that the status bar shows the status as for example: Jpanel1 Location:West. Do not rely on the component being added to the center by default. If you find that a component is missing from a container controlled by a Border Layout, make sure that you have specified the component's location and that you didn't put another component in the same location.

• You can also drop all the five components in any one of the areas (i.e. north, south,etc..) and

then they can be arranged by using the Border Layout Constraints dialog. • Select the Container for which the Border Layout is set and select Layout Properties in the

pop-up menu to open up the 'Border Layout Constraints' dialog as shown below. Here you can fix your desired position for each of the components. The Horizontal and Vertical Gap can also be set.

Resizing in Border Layout The CENTER component cannot be resized. The NORTH and SOUTH component's size can be increased in the vertical direction. The EAST and WEST component's size can be increased in the horizontal direction. The CENTER component fills up rest of the space.

Page 134: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 133

BorderLayout properties The layoutProperties for BorderLayout allows us to set the HGap, VGap and component position.

• HGap - Horizontal spacing between components. • VGap - Vertical spacing between components. • Position - Position of each component can be set here by selecting the component and its

corresponding position in the combobox.

Aligning Beans in BorderLayout The beans in this layout are aligned to the borders (East, West, North and South directions) automatically. Therefore none of the alignment, spacing or sizing properties are applicable for this type of a layout. When you right click on a multiple selected beans, none of the options are enabled.

Page 135: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 134

8.8.4 Using Grid Layout Grid Layout makes a bunch of components equal in size and displays them in rows and columns. A Grid Layout places components in a grid of cells. Each component spans only one cell.

• Each component takes all the available space within its cell, and each cell is exactly of the same size.

• If you resize the Grid Layout window, you'll see that the Grid Layout changes the cell size so that the cells are as large as possible, given the space available to the container.

• At least one of the rows and columns arguments must be non zero. • The horizontal Gap and vertical Gap allow you to specify the number of pixels between cells.

If you don't specify gaps, the default value '5' is set. • The container is divided into equal-sized rectangles and a component is placed in each

rectangle. Here the components cannot be resized. • These properties can be set using the Layout Properties Dialog.

How to use it

• Create a new screen. Click on the screen and do a right click on it to open the pop-up menu. • Choose Grid Layout from the Layouts and click on it. • Select the Container for which the Grid Layout is set and select Layout Properties in the

popup menu to open up the 'Grid Layout Customizer'. • The number of rows and columns can be specified here. • The Horizontal and Vertical Gap can also be set here (by default it is 5 ).

Resizing in GridLayout The container is divided into equal-sized rectangles and a component is placed in each grid. Here the components cannot be resized. GridLayout properties

The layoutProperties for GridLayout allows us to set the HGap, VGap, no of rows and no of columns.

• HGap - Horizontal spacing between components. • VGap - Vertical spacing between components. • No of Rows - no of rows in which the components can be placed. • No of columns - no of columns in which the components can be placed.

Page 136: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 135

Aligning Beans in GridLayout The beans in this layout fills the complete the layout area automatically. Therefore none of the alignment, spacing or sizing properties are applicable for this type of a layout. When you right click on a multiple selected beans, none of the options are enabled.

Page 137: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 136

8.8.5 Using Gridbag Layout GridBag Layout is the most flexible and complex layout manager. A GridBag Layout places components in a grid of rows and columns, allowing specified components to span multiple rows or columns. Not all rows necessarily have the same height. Similarly, not all columns necessarily have the same width. Essentially, GridBag Layout places components in rectangles (cells) in a grid, and then uses the component's preferred sizes to determine how big the cells should be. How to use it

• Create a new screen. Click on the screen and do a right click on it to open the pop-up menu. Choose GridBag Layout from the Layouts and click on it.

• Drop the components onto the screen. They will be placed one after the other. • The components of a particular type will be of some default size predetermined by the

GridbagLayout.The sizes of the individual components can be set as desired by the user by using the Gridbag Layout Customizer.

• Select the Container for which the Gridbag Layout is set, click on Layout Properties in the pop-up menu and open up the 'GridBag Layout Customizer'. You will find all the components in a straight line.

• Here you can drag any component and position it in the required grid. • The constraints has to be specified for the individual component in the table in the GridBag

Layout Customizer. • For Information on how to specify the various GridBag Layout constraints in the customizer,

see Grid Bag Layout Constraints. Resizing in GridBagLayout Resizing is not allowed in GridBagLayout. Any particular component's width and height can be changed by setting the appropriate constraints for that component in the 'GridBag Layout Customizer'.

Page 138: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 137

GridBag Layout properties The figure below shows the GridBag Layout Customizer. GridBagConstraints for each component can be set by selecting that particular component and setting its constraints.

Grid Bag Layout Constraints GridX, GridY

The purpose of this is to specify the row and column at the upper left of the component. The address of the leftmost column is gridx=0. The address of the topmost row is gridy=0. GridBagConstraint "RELATIVE" is used to specify that the component be placed just to the right of (for gridx) or just below (for gridy) relative to the component that is added to the container just before adding this component. Specifying the gridx and gridy values for each component specifies the coordinates exactly.

GridWidth, GridHeight This specifies the number of columns (in the case of gridwidth) or rows (in the case of gridheight) of the display area meant for the component. These constraints are used to specify the number of cells that the component uses. The GridBag Constraint 'Remainder' is used to specify that the component be the last one in its row (in the case of gridwidth) or column (in the case of gridheight). GridBag Constraint 'Relative' is used to specify that the component be next to the last one in its row (in the case of gridwidth) or column (in the case of gridheight). GridBagLayout allows components to span multiple rows only when the component is in the leftmost column or when you have specified positive gridx and gridy values for the component.

Page 139: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 138

Fill This is used when the component's display area is larger than the component's requested size. This determines whether to resize the component and if so, in what manner. Valid values are NONE, HORIZONTAL, VERTICAL and BOTH. NONE is the default value. HORIZONTAL makes the component wide enough to fill its display area horizontally but not to change its height. VERTICAL makes the component tall enough to fill its display area vertically, but does not change its width. BOTH makes the component fill the display area horizontally and vertically, i.e. , entirely.

Anchor This is used when the component is smaller than its display area. This determines where (within the area) the component is going to be placed. The valid values are CENTER(default), NORTH, NORHTEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST and NORTHWEST.

IPadX, IPadY

This specifies the internal padding i.e. how much to add to the minimum size of the component. The default value is zero. IPadX determines the padding in the 'x' direction. IPadY determines the padding in the 'y' direction. The width of the component will be at least its minimum width plus ipadx*2 pixels because the padding applies to both sides of the component( ipadx on either side). The height of the component will be at least its minimum height plus ipady*2 pixels (ipady on either side).

WeightX, WeightY

Weights are used to determine how to distribute space among columns and among rows. This is important for specifying resizing behavior, e.g., how a component resizes when the container that it is stored in is resized.

Generally weights are specified with 0.0 and 1.0 as the extremes: the numbers in between are used as necessary. Larger numbers indicate that the component's row or column should get more space. For each column, the weight depends on the highest 'WeightX' specified for a component within that column, with each multicolumn component's weight being split between the columns the component is in. Similarly, each row's weight is related to the highest 'WeightY' specified for a component within that row. Any extra space tends to go toward the rightmost column and the bottom row.

Insets This specifies the external padding of the component. This is the minimum space between the component and the edges of its display area. The value is specified as an Insets object.

Aligning Beans in GridBag Layout The beans in this layout occupies fixed positions in the layout automatically. Therefore none of the alignment, spacing or sizing properties are applicable for this type of a layout. When you right click on a multiple selected beans, none of the options are enabled.

Page 140: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 139

8.8.6 Using Card Layout The Card Layout class allows you to implement an area that contains different components at different times. Card layout allows the user to manage the components under their control as a stack of cards, displaying only one card at a time. You can name the components and set the Card Layout Manager to display them in the order you wish. Of course, the 'cards' can themselves be panels containing components including panels. How to use it

• To use the Card Layout, drop a panel on the screen, do a right-click on the component and set the Layout to be Card Layout.

• Drop a few other components on the panel, say two image labels. • Now add a button and establish connection between the components. • By customising the code to show the required card, you can set the card required to be

displayed. Resizing in CardLayout Since the complete panel is occupied by any one component at a time, resizing is not possible in this layout. CardLayout properties Layout Properties helps us to define the Cardname for each card and the cards can also be rearranged using up and down button. The horizontal gaps are placed at the left and right edges. The vertical gaps are placed at the top and bottom edges.

Aligning Beans in CardLayout Each bean in this layout fills the complete layout area to form different cards automatically. Therefore none of the alignment, spacing or sizing properties are applicable for this type of a layout. As you will not be able to select multiple beans in this layout, the popup menu itself is not shown up.

Page 141: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 140

8.9. Interaction between Components Connecting two Bean components is one of the important features of the AdventNet Bean Builder. The Interaction Wizard which is invoked by right clicking any component can be used for connecting the beans. Though most of the bean components can provide some functions by setting the proper properties, they need to interact with other beans to provide meaningful function. AdventNet Bean Builder provides a graphical means of achieving this connection between bean components. Though complex connections might need custom code simpler interactions can be achieved visually. Steps involved in connecting the beans

• In the Bean Builder screen do a right click on the selected bean component and choose the Interaction wizard menu item from the pop-up menu. This bean becomes the source bean.

• The Interaction wizard menu item lists the events that can be generated by the bean. • Selecting an event lists the method that deals with the event. • Select a method from this list and drag a "rubber-band" line to the target bean. • Dragging the line and clicking on the target bean pops-up the Interaction wizard which is used

to connect the source and the target bean. • The Interaction wizard takes three steps to create a connection.

1. The first step looks as given below:

Page 142: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 141

The first step provides three options. They are:

• Connect directly. • Create new connection class. • Reuse old connections.

Connect directly: This option is enabled when the target bean has already implemented the required listener interface. So the target bean can be directly added as the listener to the source bean for the selected event. This option is useful when the target bean is aware of the particular event. When this option is selected, pressing the Finish button creates the required connection and closes the Wizard. Create new connection class: On selecting this option the Bean Builder creates a skeleton connection class that implements the required listener interface. This class acts as the listener to the source bean for the selected event. The target bean is passed to this class. The actions to be performed on the target bean can be specified by writing some custom code inside this connection class in the third Step. Reuse old connections: This option is enabled when there is at least one connection class between the same source and same target and the same event already exists. One of these classes listed in the drop down choice box, can be selected for reuse. This class implementation can be modified by proceeding to the second step. Otherwise pressing Finish button creates the required connection class and closes the Wizard. For example, suppose you have already made a connection between a JButton and a JTextField for the Mouse Event with method being "mouseClicked". Now , suppose that you make another connection between JButton and the same target JTextField, for the MouseEvent with method being "mousePressed", the "Reuse old connections" option gets enabled. The connections made using this wizard are made active in the Bean Builder screen, only when the Check box named Design Time connection is checked.

Page 143: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 142

2. The second step looks as given below

The name and package of the connection class can be specified in the first two text fields.

• The connection class types available are anonymous , inner or separate. This is selected using the radio button.

Direct: The connections are made directly without any adapter classes. This option is available only when a bean understands the event thrown by another bean and also implements the necessary interfaces to be added as a listener for that bean. Design time connection is possible but user cannot add his own code. Anonymous/Inner: For these types of connections the generated adapter code is added into the screen's source as an Inner/Anonymous class. Since these classes can be compiled only along with the screen, design time connection is not possible. But all the components in the screen and the variables declared in the screen's source can be used. Separate: If the selected type is separate then a separate java file is created for the adapter class. Design time connection is possible but only other components in the screen can take part in the connection. Variables declared inside the screen's source file cannot be used. If the selected type is separate then a separate java file is created for the connection class. For the other two types the connection class code is added into the code for the screen.

Note: • Other than direct, all other connection types can be interchanged at any

time. • Inner connection types are more preferable as they do not create too many

separate connection files.

Page 144: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 143

• The list box titled "List of available beans" lists all the beans that are currently used in the

screen. These beans can be added to or removed from the Target/UsedBeans list box using the Add and Remove buttons. Only the beans listed in the Target/Used Beans list box can be used inside the connection class.

• The name by which the beans are referred inside the connection class of type "Separate" can be edited by clicking on the bean in the Target/Used Beans list box and editing it in the "Referred As" text field.

Having set the required values and clicking on the Next button leads to the third step. 3. The third step looks as given below

• The drop down choice box on the top has the list of arguments passed to the selected listener method, in addition to the beans that are referred in the connection class.

• The listbox below lists the methods or properties of the Item selected in the above drop down combobox. The content of this list box changes according to the selection made in the adjacent radio buttons.

The meaning of selecting each radio button can be listed as follows • Set Properties - lists the write-only and read/write properties of the selected bean in the list

box. • Get Properties - lists read-only and read/write properties of the selected bean in the list box. • Exact arguments - lists the methods of the selected bean that take in same arguments as

the selected listener method.

Page 145: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 144

• All members - lists all the methods and fields of the selected bean. • The drop down choice box named ListenerMethod below the list box contains the list of

methods in the selected listener interface. • The text area below contains the code for the connection class . Based on the method that is

selected in ListenerMethod choice box, the cursor is placed inside the respective method in the text area. The code for this method can be entered here.

• The Add button adds the method selected in the list box, on to the code area. The added method may not always be supplied with appropriate arguments. The arguments of this method might have to be edited to take appropriate values.

Once the above operation is complete, pressing the "Finish" button creates the required connection. Any error such as compilation errors, exceptions etc., occurring during this process are reported on the message area provided below the command buttons. When no error occurs the creation of connection is completed and the wizard is closed.

Note: If the connection class created is of anonymous or of inner type, the code entered is not compiled by the wizard and hence no errors are generated. They are compiled only when the entire screen is compiled.

Connection Tree The connection tree is present in the bottom - left frame, which lists the set of connections that are made between components.

• When the user clicks on the connection with the selection in the "Screen" tab, the components that are involved in the connections are highlighted in the screen with different colors, identifying the Event Source Component (in maroon color), Event Target Component (in olive green color) and the Participating Components (in navy blue color). • Right clicking the connection name in the Connection tree will bring up the Connection Pop up Menu.

Note: Click the " Help" button and then click on a field in the dialog to view the Context Sensitive Help. For more information on how to use the Context sensitive help, refer the topic "Context sensitive Help"

The code that you write in the interaction wizard screen is shown in the source tab of the builder screen, between the <UserCode_Begin_Connection_...> and <UserCode_End_Connection_...> tags. You can also edit this code in the source editor, which will reflect in the interaction wizard screen and vice versa. This provides the convenience of editing any user written code in a single place: source editor.

Page 146: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 145

8.9.1 Editing Interaction between Components In order to establish connections between various components, the Interaction wizard is used. In case any alteration has to be done in the connection, then the code can be edited using the "Edit" option which is obtained by right clicking on the connection node in the left side connection tree. Connection Popup menu Interaction Wizard provides various options to work with the created connection. To invoke these options ,select one of the connection node (listed in the tree under the connections node) and right-click it. A pop-up menu appears with the following options.

Edit "Edit" option invokes a dialog with which we can edit the corresponding custom code in the Interaction Wizard. This gives a provision for adding users code along with the connections. "Edit" option is not supported in "Direct" type connection. Edit In Editor "Edit in Editor" option opens up the source code directly, where the custom code for the connection component can be modified. This is not viewed in the Interaction Wizard but can be viewed in the Source Editor. "Edit in editor" option is supported in "Separate" type connection. Compile Compile option helps in compilation of the connection codes of type "Separate". Design Time Connection Bean Builder supports the connection to be activated during the design time itself. This is useful for testing and prototyping. But this feature is available only for Direct and Separate type connections. This option is used to activate or de-activate the connection during the design time. Reload Connection Reload connection option helps in refreshing the connection after compilation. This option is valid only for Separate type connections and is enabled only if "Design Time Connection" option is enabled.

Page 147: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 146

Delete : The unwanted connections can be removed by the "Delete" option. Also, a connection will be lost if the target bean is deleted from the screen.

Note: Deleted connections cannot be undone.

Page 148: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 147

8.9.2 Viewing the Interaction The AdventNet Bean Builder's 'Interaction View' is invoked by clicking on the Interaction tab in the right hand side panel. The Bean Builder supports connections between one or more beans. The connection is established by right clicking the bean components in the "Screen" view and choosing the Interaction wizard and then selecting the required connection from the sub popup menu. Once the connections are completed in the screen, the Interaction View of the "components" can be seen in the "Interaction" view. The lower left-side tree of the builder consists of two folders, one with the name "components" and the other with the name "connections".

• The "Components" folder lists the components used in the screen. • The "Connections" folder lists the set of connections involved between the components in the

screen. When the selection tab is in the "Interaction" view and if the user clicks on any of the components in the Component's tree, then that component and the connections involved with that component are shown. A component can have multiple connections with different other components. In the below picture, the connection of the component "JButton1" with other component "JTextField1" is shown.

Page 149: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 148

Some special features are:

• The connections between "components" can be deleted, by selecting the connecting line in "Interaction view" as shown in the above image.

• When the selection tab is in "Screen" view and if the user clicks on any of the connection in the Connection tree, then the components involved in the connections are highlighted in the screen. The "Component" which opens the connection is the source, which is highlighted with maroon colored border line. The "Component" which receives the connection is the target, which is highlighted in olive green colored border line. The components participating in the connection is highlighted in navy blue colored border line.

Page 150: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 149

8.10 Adding Menu and Tool Bar to Applications

8.10.1 Adding Menubar This feature helps to configure Menubar for an Application built using Bean Builder. A Menubar is useful in performing various operations in an application easily with a mouse click. The need for a Menubar in an application, depends upon the type of the application and the operations that has to be performed using it. For example, a typical application with operations like Opening a file, editing, saving. etc. will need a menu bar with the respective menu items. To create a Menubar, open a new project in Bean Builder. Right click on the container screen and choose "Menus -->Create Menu" option. This invokes the "Screen Menu Configuration UI" dialog as shown below.

Page 151: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 150

Configuring the Menubar The following are the steps to be followed to configure Menubar.

• Invoke the dialog as shown above and select the node Menubar. • Now click the "Add" button to invoke the "Choose Menu" dialog as shown below.

• Choose the "JMenu" option to add a menu. Enter the menu name and click ok to close the dialog. The keyboard characters including the special characters can be set as Menu name.

• A node gets added with the menu name you have provided under the Menubar node in the left side tree.

• A menu can contain the menu items JMenuItem, JRadioButtonMenuItem, JCheckBoxMenuItem, Separator as shown in the image above. A menu can also have a submenu as a menu item, which is obtained by adding a JMenu under the respective menu node.

• To add items under a menu, choose the corresponding Menu node in the left side tree and then click the "Add" button to invoke the "Choose Menu" dialog. Now choose the desired type of menu item and enter the name of the menu item and click ok.

• You can see the specified menu item added as a node under the respective Menu node. • To change the order of the items, interchange the positions of the nodes in the "Screen Menu

Configuration UI" by using "Move Up", "Move Down" buttons. • To remove a menu or menu item, use the "Remove" button. • Click on the menu item node to get the respective configuration screen in the right hand side. • In the screen provide the Action Command, Mnemonics, Short cut key and the action code for

the menu item. • Repeat the above steps to add more menus to the menu bar and menu items to menu. Close

the "Screen Menu Configuration UI" dialog when you finish adding menus and menu items to it.

• You can see the configured Menu bar in the container screen as shown in the picture below, which is an example Menu bar created.

Page 152: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 151

• It has 3 Menus namely "File", "Edit" and "Help". Each one is a JMenu that is added to the Menubar.

• The Menu "File" has the following menu items and their respective action codes. o JMenuItem named as "Open". o JMenuItem named as "Save". o A separator. o JRadioButtonMenuItem named as "Debug". o A separator. o JMenuItem named as "Exit".

• Similarly other menus, "Edit" and "Help", have their respective menu items.

Page 153: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 152

8.10.2 Adding Toolbar This feature helps to configure Tool Bar for an Application built in Bean Builder. A Tool Bar is a pictorial interface which has a collection of Tool buttons performing various operations. Most often the tool buttons perform the same operations defined in the Menu Bar. For example, the commonly performed operations like "Save" and "Open Project" will be present under the "File" menu and also in the tool bar. But using the Tool button is more faster and easy, than using the menus in the Menu Bar. The tool buttons need not necessarily perform the same functions as in the menu bar, they can also perform independent operations. Configuring the Toolbar The following are the steps to be followed to configure Toolbar.

• Open a new project in a Bean Builder tool. Right click on the container screen and choose "Menus -->Create Menu" option. This invokes the "Screen Menu Configuration UI" dialog, as shown in the Adding Menubar topic.

• Now select the node ToolBar in the left side tree of the "Screen Menu Configuration UI" dialog.

• Click the "Add" button to configure the Tool buttons. • A dialog opens up as shown below, with editable fields "Tool Button Name" and "Icon File

Name". Enter the names and press "OK".

• A node with the Tool Button name gets added to the left-side tree under the ToolBar node. On selecting the Tool Button node, the respective screen is invoked in the right hand side. The Tooltip text and action command can be provided.

• Now insert the action code in the space provided. • If the action code is the same as a particular Menu Item in the Menu Bar , then you can select

the Menu Item from the combo box which displays all the Menu Items you have configured in your Menu Bar.

• Configure as many Tool Icons as required for your Application by following the above procedure. Close the "Screen Menu Configuration UI" dialog when you finish creating Tool buttons.

• Now you can see the tool bar appearing in the container screen as shown in the image below, which is an example of the simple Tool bar created.

Page 154: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 153

• The Tool bar shown above have the tool buttons "New", "Save" and "Help" with their respective images, tool tip text and action codes.

8.10.3 Adding Popup Menus to Components A Popup menu is the most flexible way to group the menu items corresponding to a bean or screen. They are more preferred than the menubar or toolbar. Setting popupmenus for screens or beans involves two steps:

• Creating the popup menus using the 'createMenu' option in the screen. • Associating the created popup menu to a bean or to the screen.

Creating the popupmenus using the createMenu option in the screen You can create the popup menu by following the procedure that you adopted for creating menubars. Note that the popup menus cannot have shortcut keys or mnemonics like menubars. So create popup menus without the option of mnemonics and shortcut keys. You can create one or more popup menus as you need and you can write the custom code that is needed to be executed while invoking that menu item in that popup menu. For an application, the popup menus can be configured for the components in the screen and also for the screen itself. The popup menu is created for either the base screen or the components in it, using the container screen. i.e. in any screen, right- click on the container screen to obtain the 'Menus-->Create Menus' option and this option cannot be obtained by right-clicking any bean components in the screen. Create popup menus using the "Screen Menu Configuration UI" dialog in the following way:

• The left side of this dialog has a tree, click on the PopUpMenu node and select the 'Add' option to invoke the 'Input' dialog. Provide the popup name and click ok to close the dialog. A node gets added with the Popup name you provided under the PopUpMenu node.

• Click on the Popup menu name and select the 'Add' option to invoke the 'Choose menu' dialog to add menu items for the popup menu.

• In the dialog, select the desired option for the kind of menu item you like to have and provide the Menu item name and click ok The specified menu item gets added as a node under the PopUp Menu node.

• Click on the menu item node to get the respective configuration screen in the right hand side and provide the action code for the menu item.

• Repeat the above steps to create more popup menus and to add menu items to it. Close the "Screen Menu Configuration UI" dialog when you finish adding popup menus and menu items to it.

The below example shows a container screen with a component, Button1. The two pop-up menus created are menu1 and menu2. Let the popup menus, menu1 and menu2 have different menu items.

• menu1 has menu items : Jmenu - 'Edit'. Jmenuitem - 'Help'.

• menu2 has menu items : Jmenuitem - 'Properties'.

Page 155: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 154

Associating the created popup menu to a bean or to the screen Now after creating the popup menus, you have to associate them to the components in the screen or to the screen itself. Right click on a bean and choose "Menus-->Popup Menus", which will list you the configured popup menus with the radio button option. You can choose any one of those listed popup menus and set it for your bean. If you have more number of bean components, say 10 more components, you have to follow the same procedure for all the 10 beans. Note that you can set the same popup menu for all the 10 beans. You can also set different popup menu for each and every bean provided you have configured 10 different popup menus. Similarly, a configured popup menu can also be set for the screen too. In the above given example, the popup menu "menu1" has been set for the container screen and "menu2" has been set for the Button1 bean. On compiling and running the screen, you will find a screen with Button1. Right- clicking on the screen will show the menu items "Edit" and "Help" respective to the popup menu "menu1". Similarly, right clicking on Button1 will show the menu item "Properties" respective to the popup menu "menu2". Please note that on running the screen, only the menu items of the respective popup menus will be displayed and not the popup menu name itself. The popup menu name is useful only for associating a bean or screen with a popup menu.

Page 156: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 155

8.11 Internationalizing the Application

8.11.1 Internationalizing the Application If you are involved in developing global software, then you will be aware of the fact that one of the great commandments of internationalization is to separate text, labels, messages and other locale-sensitive objects from the core source code. This helps to maintain a single source code base for all the language versions of your product. It also facilitates translations because the resources that can be localized are identified and isolated. The Internet demands global software i.e., software that can be developed independent of the countries or languages of its users, and localized for multiple countries or regions. The Java Platform provides a rich set of APIs for developing global applications. The internationalization of APIs are based on the Unicode 2.1 character encoding and include the ability to adapt text, numbers, dates, currency, and user-defined objects to any country's conventions. The Unicode Standard defines the universal character set. Its primary goal is to provide an unambiguous encoding of the content of plain text, ultimately covering all languages in the world. Currently Unicode contains a large number of characters covering most of the currently used scripts in the world. It also contains additional characters for interoperability with older character encoding, and characters with control-like functions included primarily for reasons of providing unambiguous interpretation of plain text. Unicode provides specifications for the use of all of these characters. Internationalization The AdventNet Bean Builder supports Internationalization . The option to internationalize the project by generating the internationalized source is found in the "Project Properties" form in the "Source Generation " tab.

Page 157: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 156

Internationalize the Source : This option is provided to internationalize the source generated. If you wish to internationalize the source check the option and provide the required details in the Locale Properties dialog. The Locale Properties dialog is invoked when you click the Locale Properties Button.

Locale The locale is a file that has a mapping of the words in one language on the left hand side to the words of the other language in the right-hand side.

Resource Bundle

Resource bundles contain locale-specific objects. When your program needs a locale-specific resource, a String for example, your program can load it from the resource bundle that is appropriate for the current user's locale. In this way, you can write program code that is largely independent of the user's locale isolating most, if not all, of the locale-specific information in resource bundles. The method getBundle() locates the locale file. The method getString() gives the mapping from English to the new language.

One resource bundle is, conceptually, a set of related classes that inherit from ResourceBundle. Each related subclass of ResourceBundle has the same base name plus an additional component that identifies its locale. For example, suppose your resource bundle is named as MyResources then the class you are likely to write first is the default resource bundle, which simply has the same name as its family--MyResources. You can also provide as many related locale-specific classes as you need. For example, perhaps you would provide a German one named MyResources_de.

If there are different resources for different countries, you can make specializations. For example, MyResources_de_CH is the German language (de) in Switzerland (CH). If you want to modify some of the resources in the specialization, you can do so.

How to Internationalize the Source To internationalize the source, go to Project Properties in the "Properties Menu" . Select the "Source Generation" tab and select the CheckBox corresponding to "Internationalize the Source". You will find a button by name "Locale Properties" alongside. Clicking it brings up a dialog that has a combo box which has the list of locales. Select the required Locale, click the "OK" button and then close the "Project Properties" window.

Click on "Regenerate" menu item under the "Build" menu of the tool for internationalization setting to take effect. The selected value for the Locale is set as a Project Parameter which is available in Project Properties in the 'General' Tab.

Page 158: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 157

The two parameters related to Internationalization are RESOURCE_PROPERTIES that represents the Bundle Name and RESOURCE_LOCALE that represents the Locale. By making the required changes either in the Project Parameters or in the Locale Properties Dialog the generated source can be internationalized.

Variable Name

The source will be generated with the variable name as shown below. By default it is set as "resourceBundle", it can be changed as desired by the user

For E.g., if the variable name is not changed then the source corresponding to internationalizing a JButton text will be

// JButton1.setText(resourceBundle.getString("OK"));

Bundle Name

The user can specify his resourceBundle name here. By default it is <ProjectName>Resources.

Locale

It helps to determine for which language the source is being generated. Suppose the user wants the application in a particular language, he can select the language from the combobox. Then the Resource bundle is named with the language extension. For example,

<ProjectName>Resources_ar_DZi corresponding to the ar_DZi Locale.

Editing the locale file

The locale file is <ProjectName>Resources.properties . So, if the name of the project is "default", the name of the locale file is defaultResources.properties. The <ProjectName>ResourcesEditable.properties and the <ProjectName>Resources.properties can be found in the classes directory of your project (i.e. in the <Web NMS Home>/projects/<ProjectName>/classes) directory. The <ProjectName>ResourcesEditable.properties file is created with the English characters on the left side followed by a "=" and then the same characters in English as default. The user should open the <ProjectName>ResourcesEditable.properties file and enter the required language characters in the right hand side. Then the source has to be regenerated using the Build --> Regenerate menu item. When a regenerate is performed , the "native2ascii" command is executed and the UNICODE version of the characters is entered in the right hand side of the <ProjectName>Resources.properties file. Now, if the user Compiles the application and tests it, he can find the application in the specified language.

native2ascii tool

The purpose of native2ascii tool is to generate Unicode characters for a given set of characters in a file. To support intenationalization java expects all characters to be in Unicode format in the properties file. If the user is writing a locale for JAPANESE properties file, then he cannot type in the Unicode values for each and every Japanese character. So what the Bean Builder does is that it allows the user to enter his own Locale properties in a file called <ProjectName>ResourcesEditable.properties. Using the native2ascii tool provided in the JDK the values in the <ProjectName>ResourcesEditable.properties file are converted to <ProjectName>Resources.properties. This tool is run internally by the builder especially after each and every time the user regenerates the source. So after editing the

Page 159: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 158

<ProjectName>ResourcesEditable.properties file, the user has to go and regenerate the source to execute this native2ascii tool.

Example

• Drop a JLabel on to the Draw Area and in the 'Property Form' specify the text value

as 'one'. • In the 'Project Properties' form, select the choice for 'Internationalize the source' in

the 'Source Generation' tab. • Double click the 'Locale Properties' button. • In the Locale Properties dialog change the locale to any language of your choice say

ar_AE. • Confirm your choice by using the 'OK' button to close the dialog and then close the

Project Properties form. • Click on 'Regenerate' in the 'Build' Menu. • Go to the <Web NMS Home>/projects/<ProjcetName>/classes directory. • In the <ProjectName>ResourcesEditable.properties file edit the right hand side of

'one = one' so that it is now changed to 'one = this'. • Save the file and then regenerate using the 'Project --> Regenerate Project' menu

item. This runs the native2ascii command. • Now you can 'Compile and Run' the screen that contains the JLabel. • Instead of 'one', 'this' will appear on the JLabel as text.

The above illustration thus explains about internationalizing the Bean Builder project.

Page 160: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 159

8.12 Configuring Java Security Policy

8.12.1 Using Policy Tool Policy tool is a java tool that helps you to overcome the applet restrictions. You can use the Policy Tool to create and modify the external policy configuration files that define your installation's security policy. It can be invoked either through the Bean Builder or by issuing the policytool command from the command prompt. If your application is of Build type Applet, they have a security restrictions in them. You must define a Java Policy to overcome the security restrictions imposed by java, to run the application. The Steps on how to create a Policy and specify it for your application are explained in the steps below.

1. Open the Bean Builder tool. 2. Go to the tools menu. 3. Click on the policy tool menu item. 4. This will invoke the java policy tool. On opening it might complain saying some policy file

doesn't exist. Ignore the message. 5. Click on the Add Policy Entry button. 6. This will invoke another frame named policy entry. Click the button named Add Permission.

This invokes another dialog named Permissions. 7. Click on the ComboBox which has a starting item named Permission: 8. From the drop down list select AllPermission and click ok. 9. Click done in the policy entry frame. 10. Now finally the Policy tool is left. Click on the File menu and select save as menuitem. 11. This invokes a save dialog. Enter the name of the file say mypolicy. (Remember this name as

you have to use this policy file). Now you have completed setting up the permissions file. Then you have to tell the application that it has to use this policy file while running. So follow the steps given below to give permission to your application.

1. Go the Properties menu in the Bean Builder tool and invoke the Project Properties menu item. 2. This brings up the Project Properties dialog. In the dialog select the runsetup tab. 3. In the screen currently displayed click the button beside the java variables. 4. This invokes a dialog titled Java Param. 5. Now in the left side of the screen there is combobox with first item showing as JAVA. Click the

combobox and select SECURITY. 6. Now click on the combobox on the right side with first item showing as Options and select -

Djava.security.policy. 7. Now the final step is in the field beside the value label type in the name of the policy file that

you have saved. 8. Now click ok and come out of the Project Properties.

Now you have finished giving permission to your application. Finally test your application as applet. It will not complain about any access denied errors. Thus you can define the policy to overcome the java's restrictions using this tool. To know more about the tool refer to http://java.sun.com/docs/books/tutorial/security1.2/toolsign/wstep1.html You can have further knowledge of the various security tools provided by java in the following link. http://java.sun.com/products/jdk/1.2/docs/guide/security/SecurityToolsSummary.html

Page 161: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 160

8.13. Source Generation The Bean Builder provides features like automatic source code generation for applications developed using the Bean Builder Integrated Development Environment. The source files that are generated by the Bean Builder can be edited or modified by the user. Link to the topics that follow in this session are given below.

• Source View • Editing Source Files • Source Code Flow for different Build types • Source Code Generation

Other than the above topics, Source code regeneration and Screen/Source backup are explained below. Source Code Regeneration The source code that get generated once are regenerated under the following conditions:

• Changes incurred to an already existing screen (For instance, dropping a bean component, Editing a bean component or removing it).

• Renaming an existing screen. • Changing the Build Type (For instance applet, application,panel ,dialog etc) of the screen. • Compiling an existing screen.

Screen and Source Backup The backup for the screen gets generated in the following circumstances:

• Deleting a screen. • Whenever a screen is saved (over an existing saved screen). • Renaming an existing screen. • Changing the Build Type. • When parsing the source file. For example, when a bean is added to a screen and the source

is regenerated, a backup file is created. The backup of files will be taken only when the parsing of the file is done for the first time. The file is read in that session of the Bean Builder. The file is not parsed again until the user has modified the file either through the Bean Builder IDE or through editor provided in the Bean Builder namely Jmacs or through any other editors. The user can modify the code outside the Bean Builder even when the Bean Builder is running though it is not advised to do so.

o Creation of Backup files In the above listed circumstances, backup is created in <Web NMS Home> under the projects --> <your project> -->"BackUp" directory. The files will be backed up as <fileName>.configbkup and <fileName>.javabkup (e.g test.config-->test.configbackup & test.java-->test.javabkup).

Note: The already existing older backup files will be moved to <fileName>.configbkup~ and <fileName>.javabkup~ (e.g test.configbkup~ and test.javabkup~)

o Restoring Backup files

Whenever you need to restore from the backup file, do the following. For example when you delete a screen, copy and paste the corresponding screen's config backup file (<fileName>.configbkup) inside "<Web NMS Home>/projects --> <your project> --> Screens" directory and rename it as <fileName>.config. Now reload/open your project in Bean Builder to find the restored screen.

Page 162: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 161

8.13.1 Viewing the Generated Source The AdventNet Bean Builder "Source" View can be invoked by clicking on the "Source" tab as shown in the below image.

The AdventNet Bean Builder can build applet, application, frame or panel from each screen. The corresponding source files are available in the Source editor which can be used by the developer to customize it. The source files are generated by simply switching over from "Screen" to "Source" tab. If the source files are already generated by other options the same can be seen in the Source editor.

Page 163: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 162

OOBrowser View If the selection is in "Source" tab , the left-side tree will list the set of methods, classes and variables that belongs to the Java file that is currently opened in the editor.

• When the user clicks on the method the code corresponding to that method is highlighted in the editor. If the user clicks on a variable the code that corresponds to that variable is highlighted in the editor. This feature allows highlighting the members, classes and methods to review the source code.

• To search for a particular method or variable or class, click on the left-side tree of the "Source" view and type in the beginning few letters of the searching keyword.

Page 164: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 163

8.13.2 Editing Source Files You can edit the source files that are generated by the Bean Builder. But there are certain parts of the code that should not be edited. The first set of tags in the generated source are <Begin_...> <End_...>. Inside this tag are the <UserCode_...> <UserCode_...> tags. The code inside the UserCode tag can be edited. The code inside this tag is derived from the custom code tab in the bean property form or from the interaction wizard screen. You can edit these codes in either the editor or in their original position (custom code editor or interaction wizard screen).

Note: Further in the document, the <Begin_...> <End_...> tag is referred as Begin-End tags and the <UserCode_...> </UserCode_...> tag is referred as UserCode tags.

An example file EditedFile.java can be viewed to see the various ways of editing the source file. Example: public void init(javax.swing.JApplet app) { //<Begin_init_javax.swing.JApplet> this.applet = app; setVisible(true); //<End_init_javax.swing.JApplet> }

Any modifications to the code within the Begin-End tags will be overwritten when the source is regenerated (by clicking on the "Regenerate" menu-item in the "Build" menu or when compiling the Screen) . The following gives the Java File structure and details about editing them:

• Package Name : By default the source file will be generated with the default package name of the project. The package name can be entered in the menu item "Properties-->Project Properties-->Source Generation tab". This package name should not be edited by the user. • Imports:

User can add,modify or remove import statements. Bean Builder will add the necessary imports needed by the Bean Builder generated code during regeneration if they are not present. • Class Name and Extends :

These will be overridden to reflect that of the screen name and type. • Implements :

User can add,modify or remove the different interfaces to be implemented by the class. Bean Builder will add more interfaces to be implemented, if they are not present but required for the screen. • Variables:

Page 165: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 164

The user is free to add, modify or remove new variables other than those generated by the Bean Builder. The variables generated by the Bean Builder are grouped together and will be inside the Begin-End Tags :

//<Begin_Variable_Declarations> private boolean initialized = false; java.applet.Applet applet = null; com.adventnet.beans.Dial Dial1 = null; //<End_Variable_Declarations>

The user shouldn't modify or remove these variables. • Methods and Constructors:

User can add new methods, modify methods or remove methods. The Bean Builder will update the necessary methods when regenerating the file. The methods that are generated by the Bean Builder will have the following structure: [<Access Modifiers (e.g.: public,void)>] MethodName ([ argument list]) { //<Begin_MethodSignature> //<End_MethodSignature> }

Example: public void init(javax.swing.JApplet app) { //<Begin_init_javax.swing.JApplet> this.applet = app; setVisible(true); //<End_init_javax.swing.JApplet> }

The user can edit the methods to add code above and below the Begin-End tags. The modified above example: public void init(javax.swing.JApplet app) { if(this.applet != null) { return; } //<Begin_init_javax.swing.JApplet> this.applet = app; setVisible(true); //<End_init_javax.swing.JApplet> System.out.println(" init called " + applet.getWebServerBase()); }

The possible scenarios and the behavior of the Bean Builder in those scenarios are explained below.

o Updating Methods already present in the source file:

Page 166: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 165

If Begin-End tags are present in the method, then the Bean Builder will update the code within the Begin-End tags. If the Begin-End tags are not present (i.e. the method was originally added by the user), then the Bean Builder will add the code (in Begin-End tags) at the end of the method. If method contains only the Begin-End Tags and the user has not added any code or comments in that method and if the method is not needed, then that method will be removed. For example if the build type is Application the method public static void main(String args[]) will be generated in the source. If the type is changed to Applet and if the main method was not modified by the user (i.e it contains only the Begin-End tags) then the main method will be removed. Otherwise, if modified by the user only the code within the Begin-End tags will be removed and not the main method. For example, 1. This main method will be removed when type is changed to Applet: public static void main(String [] args) { //<Begin_main_String[]> untitled frame = new untitled(); frame.setVisible(true); //<End_main_String[]> }

2. This main method will not be removed but only updated if build type is Application. public static void main(String [] args)

{ if(args.length == 0) { System.out.println(" No arguments specified "); System.exit(-1); } //<Begin_main_String[]> untitled frame = new untitled(); frame.setVisible(true); //<End_main_String[]> }

o New methods added by the Bean Builder will be appended to the end of the class:

When adding new methods please give the fully qualified class names for arguments. For example, give the name as public void add(javax.swing.JButton jbArg) rather than public void add(JButton jbArg) as it is easy to update those methods.

• Inner Classes:

The user can add new inner classes. But the user should not modify or remove the inner classes generated by the Bean Builder. These inner classes will be within the Begin-End tags. • More than one class within the same file:

The user can add new classes at the end of the file. But it is preferable to avoid since if due to some reason the parsing of the source file fails, then the new methods will get added before the last braces "}".

Parsing Errors/Recovery

Page 167: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 166

The Bean Builder will try to recover from parsing errors as much as possible. If there are any unrecoverable parsing errors, then the user has the option of either generating the whole file completely (the original file will be backed up) or aborting the current operation. Sometimes the source generated by the Bean Builder itself might be unparsable. This scenario will occur mostly due to misplaced parenthesis inside the code written in the Custom code editor of the bean property form or the interaction wizard screen. If that occurs then the code that is generated by the Bean Builder saved as "<screen-name>.problem" . Generally unrecoverable parsing errors occur due to the misplaced/unmatched braces i.e. '{' & '}' and misplaced/unmatched parenthesis i.e. '(' & ')' . When editing the source file extra precaution should be taken to close all open braces and parentheses. Example Java File An example java file is shown below .The code that has been added by the user is highlighted in blue. The comments in green are added here for explanation. They will not be present in the original file. // Please do not edit code in between the comments "//<Begin_...>" and "//<End_...>". // Any changes made within the comments will be lost ,if regenerated. // For more details please see EditingSourceFiles.html present in the docs directory package ExamplePackage; //User can add his own imports import java.net.*; import javax.swing.*; import java.io.*; import java.awt.*; import javax.swing.event.*; import java.awt.event.*; import Servers.*; public class new_screen1 extends JFrame implements ActionListener { //<Begin_Variable_Declarations> private boolean initialized = false; java.applet.Applet applet = null; javax.swing.JLabel JLabel1 = null; javax.swing.JButton JButton1 = null; //<End_Variable_Declarations> //User can add new variables private SimpleServer testServer; public new_screen1() { //<Begin_new_screen1> this.setSize(615,400); this.setTitle( " new_screen1" ); //<End_new_screen1> } //Can add throws clause and also code in the beginning and at the end of the Bean Builder generated //methods public void init() throws java.io.IOException

Page 168: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 167

{ System.out.println(" inside init "); testServer = new SimpleServer("defaultConfiguration.conf"); //<Begin_init> if (initialized == true) return; // Set the layout for the container getContentPane().setLayout(null); // let us set the initialzed variable to true so // we dont initialize again even if init is called initialized = true; // Instantiate the beans and add them, if they are visible //Instantiate JLabel1 JLabel1= new javax.swing.JLabel(); getContentPane().add(JLabel1); JLabel1.setBounds(195,120,190,95); //Instantiate JButton1 JButton1= new javax.swing.JButton(); getContentPane().add(JButton1); JButton1.setBounds(60,130,40,20); //Set the Bean properties which have been modified. //Setup the connections between the various Beans JButton1_JLabel1_conn1 JButton1_JLabel1_conn11 = new JButton1_JLabel1_conn1(); JButton1.addActionListener(JButton1_JLabel1_conn11); // let us add the init code entered in the screen.. //<End_init> testServer.addActionListener(this); System.out.println(" Successfully finished initializing "); } public static void main(String [] args) { if(args.length != 2) { System.err.println(" Usage: Example <hostName> <port> "); System.exit(0); } try { //<Begin_main_String[]> new_screen1 frame = new new_screen1(); frame.setVisible(true); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { System.exit(0); } }); //<End_main_String[]> frame.connect(arg[0],arg[1]); } catch(Exception ex)

Page 169: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 168

{ System.err.println(" Unable to start. Exception occurred . " +ex.getMessage()); } } public void setVisible(boolean bl) { try { //<Begin_setVisible_boolean> if(bl) { init(); super.setVisible(true); } else { stop(); super.setVisible(false); } //<End_setVisible_boolean> } catch(Exception ex) { System.err.println( "Exception occurred " + ex.getMessage()); } } //User added methods public void connect(String hostName,int port) throws java.net.BindException { testServer.connect(hostName,port); } //Tip : Using this if(false) construct user can avoid the default code added by the Bean Builder // from being executed. public String getParameter(String input) { if(false) { //<Begin_getParameter_String> return ""; //<End_getParameter_String> } return null; } // This method can be removed by the Bean Builder if it is not needed as the user has // not modified it public void stop() { //<Begin_stop> //<End_stop> }

Page 170: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 169

//Bean Builder added inner class. User is not allowed to modify it //<Begin_class_JButton1_JLabel1_conn1> class JButton1_JLabel1_conn1 implements java.awt.event.ActionListener, java.io.Serializable { //<TOP_PART> - Please do not remove this comment or write any custom code above this //Listener Interface Methods Are Added Below public void actionPerformed( java.awt.event.ActionEvent arg0) { JLabel1.setText( arg0.getActionCommand()); } } //<End_class_JButton1_JLabel1_conn1> public void actionPerformed(java.awt.ActionEvent actEvtArg) { JLabel1.setText(actEvtArg.getActionCommand()); } //Inner Class added by the user private class MouseLis extends MouseAdapter { public void mouseClicked(MouseEvent mEvtArg) { System.out.println(" MouseClicked " ); } } }

Page 171: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 170

8.13.3 Source Code Flow for different build types

Flow Chart

Page 172: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 171

Explanation

init () :

If the build type is Applet, this method is called by the applet viewer to inform this applet that it has been loaded. It is always called before the first time that the start method is called.

In other build types (Application, Frame, NMS Frame, Panel, NMS Panel and Dialog), this method is called when the GUI is set visible.

This method would call up the other initializing methods like initvariables(),setUpGui()setUpProperties(),setUpConnections().

initVariables() :

Initializes all the components used in the user interface.

start() :

It is called by the applet viewer to inform this applet that it should start its execution. It is called after the init method and also each time the applet is run. Again in the application build type the method is called when the frame is set visible. setUpProperties(): In this method the different properties are set for the various components in the screen. stop() : It is called by the browser or applet viewer to inform this applet that it should stop its execution. It is called just before the applet is to be destroyed or when the application window is closed by the user.

Page 173: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 172

8.13.4 Customizing Source Generation Source code in Bean Builder is generated from Templates files. You can customize the code generated by the Bean Builder, by editing these Template files. The templates are available in the <Web NMS Home>/builder_template directory. Ensure that you do not remove the tags in the templates. The templates are as follows

• Applet Template • Application Template • ConsoleApplication Template • Dialog Template • Frame Template • NmsFrame Template • Panel Template • NmsPanel Template • CommonCode.info

Suppose that you need to generate code for Type Dialog. Then, the Bean Builder makes use of the "Dialog Template" in the <Web NMS Home>/builder_template directory to generate the source code. The CommonCode.info file is explained below and the templates are discussed in detail later in this topic. CommonCode.info The purpose of this file is to add a set of common code that are Common for all Screens in the Bean Builder. This file is present inside <Web NMS Home>/builder_template directory. This file has the Comment added by the Bean Builder and also the Error processing methods. Comment tag: The purpose of this tag <#*HEADER*#> is to add certain comment about the generated source. By default, Bean Builder will add a set of comment for all the sources irrespective of any type either its applet or application. The generated source in the Source tab will have comments like // Please do not edit code in between the comments "//<Begin_...>" and "//<End_...> // Any changes made within the comments will be lost, if regenerated. // For more details please see EditingSourceFiles.html present in the docs directory This code is common for all Template files and if the user wants to change, it can be modified in the CommonCode.info file under the <#*HEADER*#> tag as // ModuleName : <Project Module> // Author Name : <Your Name> // Dated : <DD/MM/YYYY>

Note : Since this code is common for all Build types either its an Applet or Application or Panel, this code is taken from a Common file rather than adding the same code in each and every template file. If the User needs to edit this header, he can directly edit the CommonCode.info file. Also if he needs certain comment to be added specific to only one builtType then he can add that code in the respective Template file.

Error processing methods: public void showStatus(String message) { //<Begin_showStatus_String> System.out.println("Internal Error :"+ message);

Page 174: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 173

//<End_showStatus_String> } public void showStatus(String message,Exception ex) { //<Begin_showStatus_String_Exception> System.out.println("Internal Error :"+ message); ex.printStackTrace(); //<End_showStatus_String_Exception> }

The above given Error processing methods are present in the CommonCode.info file. The User can edit it and process the error as he needs. A typical Template file will have the following tags :

• <$*header*$> • <$*packageName*$> • <$*imports*$> • <$*ClassName*$> • <$*implements*$> • <$*variables*$> • <$*otherMethods*$> • <$*debugMethods*$>

In any of the above given template files, you can find certain tags like <$*header*$> - This comment is replaced from the CommonCode.info file inside the <Web NMS Home>/builder_template directory. But, if you need to add a comment like "Dialogs to Show Error Messages" for all Screens that are specific to the built Type "Dialog", then you can add this code in DialogTemplate.tpl file as given below. <$*header*$>

//"Dialogs to Show Error Messages" In this case, the header tag in CommonCode.info file is ignored and the header tag in the template file is used and the comment added in the template file gets added to the generated source. <$*packageName*$> - This is replaced by the Package Name given in the ProjectProperties. <$*imports*$> - This is replaced by the imports that are generated by the Bean Builder. If you need you can also add your imports below this header in the Template file. These imports will be generated in the finally generated file. <$*ClassName*$> - This is replaced by the Screen Name given in the project. <$*implements*$> - This is replaced internally with the set of interfaces that the screen should implement. This interface implementation depends on the intelligence of the screen. If the Screen has Snmp or Configuration based intelligence, then they may replace this tag. Also user can add his own implements tag in the template file. <$*variables*$> - The Bean Builder generated variables are replaced by this tag. You can also add your own variables. <$*otherMethods*$> - This tag is replaced by some of the other methods that are generated by the Bean Builder. Bean Builder generates methods like setProtocolResult(), setUpMenus(), setUptoolBar() and these methods replaces this tag. For Example : If the user needs that his screen of build type "Dialog" needs to always implement ActionListener and generate the method needed for Action Listener, then he can do that in the template file.

Page 175: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 174

public class <$*ClassName*$> extends JDialog <$*implements*$> (implements ActionListener) { ...............................<other code here as in the template file> public void actionPerformed(ActionEvent evt) { } }

<$*debugMethods*$> - common debug methods are replaced from common code.info file. You can edit the methods and can process the Exceptions and errors as you need. Suppose that you need to generate the code according to a particular template that is different from the one in the <Web NMS Home>/builder_template directory. Then, you can alter the template by adding your own methods so that the source code is generated in a corresponding way. The code that is generated can be customized. If the user wishes to include a method that does debugging, you can do so by using the template. You can include code between begin and end tags in the template. The same cannot be done by editing the code in the editor (Source View ) as it will be overwritten by the Bean Builder once you regenerate the code. However in the editor (Source View) , you can edit the code above the "Begin tag" and below the "End tag". For more details see "Editing Source Files". Consider the following main method present in the "Application Template" under the <Web NMS Home>/builder_template directory.

public static void main(String [] args) { <$*ClassName*$> frame = new <$*ClassName*$>(); frame.setVisible(true); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { System.exit(0); } }); }

If the user edits this piece of code, the changes will be reflected once you regenerate the code . However, if the user edits the same in the editor (Source View), the changes will be overwritten once you regenerate the code.

Page 176: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 175

8.14 Unit Testing the Applications

8.14.1 Testing the Application A Tool-kit is complete in all aspects if it is able to provide a good environment for testing the developed application besides providing the various features for development. The developed application will have to be tested thoroughly before being implemented in real time situations. The Bean Builder provides options for testing the applications. Test Options Testing of a screen is accomplished by testing it as either an Application or an applet. The applet can be tested with an Applet viewer or with a Web Browser. ClassPath Settings: The ClassPath Settings for Testing includes

• Classes Directory corresponding to the current project (E.g. CurrentProject\Classes). • Containing Jars.

for both the Application and the Applet. For an Application the following are also included:

• ClassPath setting corresponding to the "Classpath Settings" tab of Project Properties. • In case the " Append Startup Class Path" check box is checked, the ClassPath of the tool

during start up will also be taken into consideration. Testing Panels, Frames and Dialogs as an application or applet The Main Screen for the Application can either be Applet or Application. So it is necessary for the sub screens also to behave accordingly. The "Test Screen as" option in the Project Properties provides the facility to choose between testing as applet or application. Consider the following scenario : Let the main screen be an applet and it has a sub screen (say of type Frame or Panel). Now on running the main screen, some information in the sub screen is noticed to be erroneous, which makes the sub screen to be unit tested. As this sub screen is going to be used in an Applet, it also needs to be tested as an Applet. By setting the "Test Screen as" option to Applet, a dummy applet is generated for this screen to be tested. Another scenario : Let the main screen be an Application. It would not be suitable to test the sub screens as Applet, because this would result in cache of jars consuming disk space and longer loading time which are unwarranted when we know that the whole Application has to be designed as an Application. So it is preferable to set the "Test Screen as" option to be Applet or Application based on your needs. Test with Browser Except for the type "Application", all other type of screens can be tested with the browser (In case of Panels, Frames the "Test Screen as" selection in Project properties->Run Setup will be disregarded.) Ensure that the Web Browser path is set in the Properties -->Global Properties menu when the "Test with Browser" function is used. Choose the appropriate screen and click on "Test with Browser" under the Build menu to test it.

Page 177: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 176

Using Command Line input programs It is possible to pass command line input to applications using the Input text-field in the Status Window. The value of the variable will be asked for at run-time. Enter the value of the variable and press the Enter/Return key. The value is passed to the program. This option can also be invoked by using the 'Properties --> Project Properties' menu item in the Menu Bar. Go to the 'Debug' tab in the dialogue box and check the jdb option. Now if we run the project/screen, the inputs can be given in the text-field in the Status Window to debug/run the project/screen.

Page 178: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 177

8.15. Versioning control for the Project One of the version control system is the CVS. i.e. Concurrent Version Control system. It maintains a central repository which stores files (often source code), including past versions, information about who modified them and when, and so on. It also has some additional configuration management functionality. Those who wish to look at or modify those files, known as developers, use CVS to check out a working directory from the repository, to check in new versions of files to the repository, and other operations such as viewing the modification history of a file. Working of CVS client The server in which the repository exists is referred as the CVS server. The CVS client which is bundled with the Bean Builder communicates with the remote CVS server and helps to do various CVS operations. Adding the project and screen files to the repository, versioning those files, retrieving files from the repository by version number or date or tag, etc. are some of the operations that can be performed using the CVS client. Detailed information on all the possible operations are elaborated in the chapter 'Running CVS Commands'. At present the project (.proj), screen (.config),source (.java) and image files of a Bean Builder project are handled by the CVS client to maintain the version control.

Page 179: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 178

8.15.1 Setting CVS Server options To check in or checkout or to perform any other versioning operation with the project/screen of Bean Builder, the CVS server settings has to be done. Choose the menu item 'Versioning->CVS Server options' to invoke a dialog as shown below.

CVS Server Details Server: Enter the CVS Server name in which you are maintaining a versioning system for your project. Port: The CVS Server listens on this port. The default port is 2401. Root Directory: Enter the ROOT directory in the CVS server repository under which your project will be maintained. Connection Method: Connection and authentication occurs before the CVS protocol itself is started. There are several ways to connect. At present only the pserver mode of communication is supported.

• Password Server: It refers to both a generic framework which allows the CVS protocol to support several authentication mechanisms, and a name for a specific mechanism which transfers a username and a cleartext password.

User Login Details Local CVS Directory: This is the CVS directory structure in the user's local machine. It is non- editable. By default, it displays the <Web NMS Home>/projects directory, which stores all the projects created with Bean Builder. User Name: Enter the user name who has the access to connect to the CVS Server and execute the CVS commands.

Page 180: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 179

Password: Enter the password for authentication of the user. The User can also login from the CVS Login menu item under the Versioning menu. Enter the User name and password in the CVS Login dialog as shown below:

Page 181: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 180

8.15.2 Running CVS Commands

CVS Commands The cvs commands that can be executed from the CVS client of Bean Builder are

• Import • Add File • Check in • Check out • Log • Diff • Status • Update

How to invoke the CVS client To execute the cvs commands for the selected node in the project tree, invoke the cvs client by choosing 'Versioning-->Run CVS Commands' menu item. Now choose the cvs command option as needed. The CVS client is shown below:

Page 182: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 181

The cvs commands that are executed from the cvs client UI can be monitored using the 'Output windows->Command Monitor' tab. The output and error messages are also displayed in the 'Output windows-->Status' window. The commands can also be executed by right clicking the selected node in the project tree and choosing the cvs option needed. This invokes a small window of cvs client, excluding the output windows.

Note: On executing any cvs command for the screens, it is applied to both the .config and .java files.

Page 183: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 182

8.15.2.1 Import a Project This option is used to create a new module in the cvs repository. This command has to be executed when a new project is added to the cvs repository for the first time.

• Enter the log message and the vendor & release tags. These tags are useful when you need to get back the initial version or create a branch.

• Enable the checkbox 'Check out files after Import' to check out automatically from the cvs repository to your local directory. Instead of enabling the check box, the 'Check out' command can also be used.

Warning: After importing a project, check out has to be done without fail in order to perform any other cvs operations in the future.

Output Window The output of the operations are shown in this window. It has two tads namely Command Monitor and Status tab. The command Monitor tab shows the series of commands executed by the cvs tool. The

Page 184: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 183

Status tab shows the status messages that are generated when the various cvs commands are executed. This window can be shown separately by clicking on the Detach button. Project structure in CVS repository After Importing a project, the .proj file and the corresponding project folder are added to the repository. If there were some screens present initially while importing the project, two sub folders 'Screens', 'Source' and corresponding .config and .java files will also be added to the repository. The project structure in the repository will be maintained similar to the directory structure under <Web NMS Home>/Projects directory. For example, if a project named 'test' with a screen 'example' was imported, the following structure will be created in the repository.

CVS ROOT/test.proj CVS ROOT/test/Screens/example.config CVS ROOT/ test/Source/example.java

Page 185: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 184

8.15.2.2 Add File After importing a project, new screens and java files may be created in your Bean Builder project. These screens/files should be added to the repository using the 'Add file' option. Actually, this tells the CVS that you want to version control the screen. These screens will really be added only after you check in the file.

• Make sure to use the option 'check in' to permanently add it to the repository or else enable the check box 'Select to check in files after adding'.

• Save the screen and do 'Add File' when a screen is added to the cvs repository for the first time.

• When adding a java file, make sure it is placed in the <Web NMS Home>/projects/<your project>/Source directory.

The new screen's config and java file gets added to the repository in the corresponding folders.

Warning: When adding a new screen to a project in the repository, save the project in Bean Builder and check in the project without fail.

Page 186: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 185

8.15.2.3 Check in After adding project/screens to the repository check in changes that you make in these files into the cvs server repository. You may first need to Update in order to merge your changes with the cvs server before you can check in them.

Note: On executing Add file command for a screen, it is not really added to the cvs repository. To make addition of the new screen effective in the repository, it needs to be checked in.

Page 187: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 186

8.15.2.4 Check out Project To check out a project from the repository, use this option. This checks out the project file and its corresponding projects directory & sub folder recursively under your working directory.

• On creating a new project with Bean Builder, the .proj file and the corresponding Project folder will be present under <Web NMS Home>/Projects directory by default. To check out that project, enter the project name alone (.proj extension to be avoided) in the 'Checkout Project' text field of the CVS Client.

• If you move the project (both file and its corresponding project folder) to some other directory under <Web NMS Home>/Projects directory, give the relative path of the project along with the project name (excluding .proj extension).

For example, consider a project 'test'. o The test.proj file and the directory 'test' under <Web NMS Home>/Projects directory is

moved to <Web NMS Home>/Projects/example/new/ directory. o Now after you import the project, the structure under the repository will be CVS

ROOT/example/new/test.proj and CVS ROOT/example/new/test. o When you check out the project, make sure to enter the checkout project as

'example/new/test'. When the relative path is not given properly, check out option will not work.

Page 188: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 187

o When you use the Open project option to open test.proj the next time in Bean Builder, browse for the checkout module path. i.e. <Web NMS Home>/Projects/example/new/test.proj

Note: If you move your project out of <Web NMS Home>/Projects directory, you will still be able to work with the project in Bean Builder, but it is not possible to perform any CVS operation with the project/screen.

The other checkout options available are By Date: Enabling this option checks out the project by the specified date. Retrieve revision/branch/tag: Specify the revision number or branch or tag name to check out by using that option. If no matching found use the recent one: When there is no match to the above two options, use this option to checkout the project with latest changes. (i.e. top of the trunk).

Warning: By using any of the above options, the working directory will be overwritten with the given version of the project. Take a backup of the current working project and project directory and store in some other location before using these options.

Page 189: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 188

8.15.2.5 Update File After you have checked out to create your private copy of file from the cvs repository, other developers will continue changing the central repository. From time to time, when it is convenient in your development process, you can use the update command from within your working project/screen to reconcile your local copy with the latest revisions applied to the repository (if any) since your last checkout or update.

The Update settings available are Checkout files to standard output: To checkout the file to buffer and display it in the standard output area. i.e. 'Status Window'. Using this option does not make checkout effective in your hard disk's working directory. Do not recurse into the sub folders: To update the selected node without updating recursively for sub-nodes. Create missing directories that exist in the repository: If you remove a directory locally, which still exists in the repository, it can be created in the working directory using this option. Reset any Sticky date/tag/-k options: This option retrieves the version of the file from the head of the trunk and forgets any sticky tags, dates, or options. Sticky Options Before Date: Use this option to update the selected file according to the date specification. Retrieve revision/branch/tag: Specify the revision number or branch or tag name to update. For more information on merging between branches, refer Merging between Branches. If not matching found use most recent one: When there is no match to the above two options, use this option to update the project/screen with latest changes. (i.e. top of the trunk)

Page 190: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 189

Merge Options None: No options for merging is specified. This is chosen by default. Merge with this tag/revision: To merge with the specified tag/revision of the file in the cvs repository with the local working copy of the file. Merging between Branches CVS allows you to isolate changes onto a separate line of development, known as a 'branch'. The branches also exist in the same cvs repository. When you change files on a branch, those changes do not appear on the main trunk or other branches. Later you can move changes from one branch to another branch (or the main trunk) by 'merging'. Merging involves first running cvs update command, to merge the changes into the working directory. You can then checkin that revision, and thus effectively copy the changes onto another branch.

Page 191: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 190

8.15.2.6 Viewing differences using Diff command To display the differences recursively between the cvs remote repository and your local working copy of the selected Project/screen, use this option.

Settings These are extra settings which are helpful in viewing the differences in varied formats. They can be chosen only when needed. Do not recurse into the sub folders: To show difference without recursing into sub-folders. Ignore Whitespace: To ignore white spaces between lines and show the remaining differences. Ignore case: To ignore the case differences and display the remaining differences only. Context diff: Based on the Diff comparison options, this option displays the line by line differences of both the files separately in two entries. The changes are marked by '!' sign and the additions are marked by '+' sign and the deleted portions are marked by '-' sign. Unified diff: This option works in the same way as Context diff, but displays the consolidated differences between the two files in a single entry. Color diff: To show the line by line differences of the selected project/screen file using colors. The colors are used effectively to mark the changed lines, lines added to local. etc.

Note: When using the Diff option of Run CVS command screen, color diff can be viewed even after executing any other diff option. Just enable the check box 'Color Diff' and detach the status window to see the color differentiation for the previously obtained output.

Page 192: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 191

Comparison options Use the following options according to your requirements.

• Compare your local file with the same remote revision (chosen by default) • Compare your local file against remote file with another revision/tag/branch • Compare your local file against remote file with another date • Compare two revision/tag/branch(s) • Compare the file with date

Page 193: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 192

8.15.2.7 Viewing Logs Use this option to find out the history of the selected project/screen and to display the log information.

The settings that can be done are: Log on the default branch: Displays information about the revisions on the default branch, normally the highest branch on the trunk. Do not recurse into the sub folders: To show log information of the selected node without recursing into the sub nodes/folders. Display only the file names: To display the file names alone. Display without tags: To show log information restricting all the tag information. Display without user logs: To display log information of the file without user logs. Log Filter Settings: By revision/tag: To display log information of the selected project/screen file of a particular revision number or tag name. By date: To display log information of the selected file by specifying any date. By state: To display log information by the state assigned to the revision. The states can be Exp, Dead. etc. By user: When a group of developers work in the same project, you can view the log information of files sorting out by the author or user name.

Page 194: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 193

8.15.2.8 View Status Executing this command shows the status of the selected project/screen, working revision, Repository revision, sticky tag/date/options. The status of the file may be locally modified, Up-to-date both locally and in the repository. etc. For example, the Status of a screen is shown below: =================================================================== File: new_screen1.config Status: Up-to-date Working revision: 1.1.1.1 Repository revision: 1.1.1.1 /home/saravananvs/MYCVS/REPOS/eecfd/Screens/new_screen1.config,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none) =================================================================== File: new_screen1.java Status: Up-to-date Working revision: 1.1.1.1 Repository revision: 1.1.1.1 /home/saravananvs/MYCVS/REPOS/eecfd/Source/new_screen1.java,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none)

Page 195: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 194

8.16 Packaging and Deploying Applications

8.16.1 Packaging of Jar Components The classes needed for an application would be present in one or more jars/directories. In many jars/directories only a few classes would have been actually used. But still the whole jar has to be packaged when you deploy the application/applet. This makes the application/applet heavy. The problem becomes severe for applets as all the jars need to be downloaded before the applet can start. The problem can be overcome by following these steps

• Manually find out the classes that are necessary. • Copy them from the various jars/directories and add them to a new jar • Package this new jar alone.

But the above process is very tedious. Smart jar wizard has been provided specifically to overcome this problem. Smart Jar wizard helps the user to extract the necessary classes for the project to maximum possible extent. The extracted classes are packed into a new jar which we call here as "Smart Jar". How to use Smart Jar Wizard Now let us see how to create a Smart jar which contains only the necessary classes inside it. Invoke the Smart Jar Wizard tool from the launcher. Follow the steps given below.

• Enter the new jar name to which the necessary classes needs to be added.

Page 196: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 195

• Then enter list of fully qualified class names for the application/applet. i.e. it should contain all the screens in the application/applet. Using this list as the seed, all the necessary classes for the application/applet will be obtained by parsing the classes recursively.

Page 197: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 196

• Click on 'Next' to bring up the next page. Here enter the paths in which the classes necessary for the application/applet can be found. The list should contain all the paths that are present in the Classpath for that application/applet.

Page 198: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 197

• In the next page, enter package prefixes of classes that need not be added to the Smart jar. For example, the classes that start with "java." need not be added to the Smart jar as these classes will be present anyway in any JVM in which the application/applet is run. Similarly we can add those packages that need not be added to the Smart jar.

Page 199: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 198

• Then in the next page enter the list of paths from which the classes should not be added to the Smart jar. For example you might have a jar that you would like to package as a whole rather than extracting the necessary classes from that jar and adding it to the Smart jar.

• All the available paths are also listed. From this, select the path and add it to the excluded paths list so that the classes are not extracted from this path.

Page 200: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 199

• Some classes would be using other classes dynamically during runtime using the java's reflection and class loading api (such as Class.forName). These runtime dependencies between classes cannot be found by parsing a .class file. So we need to specify the class and its runtime dependencies, so that those dependent classes will also be packaged along with that class.

Page 201: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 200

• Some classes would be using some resources such as gifs, config files. These files could be present in the jars that these classes were packaged. These resources need to be copied into the Smart jar with the same relative directory structure. So we need to specify the classes in the class list and its corresponding resources needs to be added for that class in the Resources list.

Page 202: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 201

• Once all the information is given, click the 'Generate Jar' button to generate the Smart jar. Once the jar is generated, all the related information will be displayed in the final page.

o Info The various information regarding the Smart Jar could be viewed by using this option.

o Errors Any errors encountered during the creation of a Smart Jar will be listed here.

o Excluded Packages The packages that are excluded will be listed here.

o Copied Files

Page 203: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 202

8.16.2 Packaging for AdventNet Web NMS (NAR) Applications developed in AdventNet Bean Builder can be integrated with AdventNet Web NMS using the NMS Archive file known as NAR file. The NAR file contains the necessary resources and details for integration with AdventNet Web NMS. The following are the steps involved in creating an Application and integrating it with AdventNet Web NMS.

• Develop the Application for integration with AdventNet Web NMS • Package the Application into a NAR file using the Package Wizard • Install the NAR in AdventNet Web NMS using the NarInstaller

Develop the Application for integration with AdventNet Web NMS

• For integrating the application with AdventNet Web NMS, it must be of one of the following build type

• Applet • NMS Frame • NMS Panel

• After integration with AdventNet Web NMS, the Application can be invoked from the menu in either 'Network Database' View or 'Map' View.

• Applications of Build type NMS Panel has an additional option of being represented in the AdventNet Web NMS 'Tree '.

Note : • For Build types other than the above, NAR file can not be created. • If the Application has already been built with type other than the Applet,

NMS Frame or NMS Panel, change the build type into any one of the three. Compile the screen before packaging the project into a NAR file.

Package the Application into a NAR file using Package Wizard

• After the design and development of Application, packaging can be done with the help of PackageWizard.

• Package Wizard bundles the necessary resources for integration with the AdventNet Web NMS.

• It can be invoked from within Bean Builder IDE using 'Tools ---> Package for Web NMS' menu item. Choose between 'General' or 'Device specific' options. Click on the respective links to know more about packaging using 'General' and 'Device Specific' options.

Please note that the following resources are available with the AdventNet Web NMS and will not be packaged on choosing either General or Device Specific options.

• AdventNetUI.jar • NMSClientUIInterfaces.jar • ApiUtils.jar • JimiProClasses.zip

Page 204: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 203

Install the NAR file in AdventNet Web NMS using NarInstaller

• Install the NAR file in AdventNet Web NMS using NarInstaller available with the AdventNet Web NMS.

• The NarInstaller loads the <ClassName>.nar and writes to the appropriate configuration files regarding the details of how and when to invoke the Application from the Web NMS.

• Application built of type Applet, NMS Frame and NMS Panel can be invoked from the Menu in either the Network Database View or Map View.

• Application built of type NMS Panel has an additional option of being represented in the AdventNet Web NMS Tree.

Page 205: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 204

8.16.2.1 General Packaging

Step by Step Procedure

Step 1 : Main Class Information

• Classes List - All the classes in the specified project are listed. • Select the class for which the NAR file has to be created. The build type of the

selected class must be any one of the three types : o Applet o NMS Panel o NMS Frame

• Class selected - The name of the selected class is displayed here. • Class Type Label - Build type of the selected class is displayed here. • Click the 'Next' Button.

Page 206: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 205

Step 2 : General Information

• Destination Directory - This is the directory where the < CLASSNAME.nar > will be created. Enter the desired directory where the NAR file has to be created using the ' Browse ' Button.

• Class - The class name for which NAR file has to be created. i.e. the class selected from ' Classes List ' in the previous screen.

• Nms Panel Key - o If the build type of the Application is NMS Panel or if the .java file extends

com.adventnet.nms.startclient.AbstractNmsPanel, then enter the key of the class.

o The Key value should be the same as the value returned by the key( ) method.

o Please take extra care while giving the key because this is how AdventNet Web NMS will refer to the class.

o The value is case sensitive. o By default the key() method returns the 'SCREEN NAME ' as the key.

• Click the 'Next ' Button.

Page 207: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 206

Step 3 : Resources To Install

• A Table with two columns Source Directory and Destination Directory displays the resources required for the Application.

• Source Directory - The column under the heading Source Directory in the Table will list the resources with path relative to < Web NMS Home> .

• Destination Directory - The column under the heading Destination Directory lists the resources with the path in which it will be packaged.

• Add - If any resource other than those listed are needed for the Application then it can be added as follows:

o Choose the required resource using the 'Browse' Button . o Click the 'Add' Button to add the resource to the Table.

• Modify - The resource listed in the table can be modified as follows : o Select the resource from the table. o If the resource listed under SOURCE DIRECTORY column needs to be

modified then resource displayed under ' Source ' Label has to be changed. o If the resource listed under DESTINATION DIRECTORY column needs to be

modified then the resource displayed under ' Destination ' label has to be changed.

o Click the 'Modify' Button. The modified resource will be reflected in the table. • Delete - If any unwanted resource has been added to the table then select the

unwanted resource in the table and click 'Delete ' Button. • After adding or modifying or deleting the resources click the 'Next' Button.

Page 208: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 207

Step 4 : List Of Parameters

• A Table with two columns under the heading 'Parameter' and 'Value ' displays the project parameters.

• Parameter - This column lists the parameters required for the Application. • Value - This column lists the values corresponding to parameters. • Add - Parameter can be added as follows

o Enter the required parameter and value under the Parameter and Value labels respectively.

o Click ' Add ' Button, the parameter will get added to the Table. • Modify - The parameter listed in the table can be modified as follows :

o Select the parameter from the table. o If the parameter listed under Parameter column needs to be modified then

parameter displayed under the Label 'Parameter' has to be changed. o If the parameter listed under ' Value' Column needs to be modified then the

parameter displayed under 'Value' Label has to be changed. o Click ' Modify ' Button. The modified resource will be reflected in the Table.

• Delete - To remove any parameter, select the parameter to be deleted and then click the 'Delete' Button.

• After adding or modifying or deleting the parameters click the 'Finish' Button. • A dialog that the <ClassName.nar > has been created at the < Destination Directory>

will be prompted. • Click the OK button to exit from the wizard.

Page 209: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 208

8.16.2.2 Device Specific Packaging

Step 1 : Main Class Information

• Classes List - All the classes in the specified project are listed. • Select the class for which the NAR file has to be created. The build type of the

selected class must be any one of the three types : o Applet o NMS Panel o NMS Frame

• Class selected - The name of the selected class is displayed here. • Class Type Label - Build type of the selected class is displayed here. • Click the 'Next' Button.

Page 210: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 209

Step 2 : General Information

• Destination Directory - This is the directory where the < CLASSNAME.nar > will be created. Enter the desired directory where the NAR file has to be created using the ' Browse ' Button.

• Class - The class name for which NAR file has to be created. i.e. the class selected from ' Classes List ' in the previous screen.

• Nms Panel Key - o If the build type of the Application is NMS Panel or if the .java file extends

com.adventnet.nms.startclient.AbstractNmsPanel, then enter the key of the class.

o The Key value should be the same as the value returned by the key( ) method.

o Please take extra care while giving the key because this is how AdventNet Web NMS will refer to the class.

o The value is case sensitive. o By default the key() method returns the 'SCREEN NAME ' as the key.

• Click the 'Next ' Button.

Page 211: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 210

Step 3 : Device Information

• Device type - The type of the device for which the Application has been developed is specified here viz. Linux, Windows NT ...

• Click ' Next ' Button.

Page 212: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 211

Step 4 : Resources To Install

• A Table with two columns Source Directory and Destination Directory displays the resources required for the Application.

• Source Directory - The column under the heading Source Directory in the Table will list the resources with path relative to < Web NMS Home> .

• Destination Directory - The column under the heading Destination Directory lists the resources with the path in which it will be packaged.

• Add - If any resource other than those listed are needed for the Application then it can be added as follows:

o Choose the required resource using the 'Browse' Button . o Click the 'Add' Button to add the resource to the Table.

• Modify - The resource listed in the table can be modified as follows : o Select the resource from the table. o If the resource listed under SOURCE DIRECTORY column needs to be

modified then resource displayed under ' Source ' Label has to be changed. o If the resource listed under DESTINATION DIRECTORY column needs to be

modified then the resource displayed under ' Destination ' label has to be changed.

o Click the 'Modify' Button. The modified resource will be reflected in the table. • Delete - If any unwanted resource has been added to the table then select the

unwanted resource in the table and click 'Delete ' Button. • After adding or modifying or deleting the resources click the 'Next' Button.

Page 213: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 212

Step 5 : List Of Parameters

• A Table with two columns under the heading 'Parameter' and 'Value ' displays the project parameters.

• Parameter - This column lists the parameters required for the Application. • Value - This column lists the values corresponding to parameters. • Add - Parameter can be added as follows

o Enter the required parameter and value under the Parameter and Value labels respectively.

o Click ' Add ' Button, the parameter will get added to the Table. • Modify - The parameter listed in the table can be modified as follows :

o Select the parameter from the table. o If the parameter listed under Parameter column needs to be modified then

parameter displayed under the Label 'Parameter' has to be changed. o If the parameter listed under ' Value' Column needs to be modified then the

parameter displayed under 'Value' Label has to be changed. o Click ' Modify ' Button. The modified resource will be reflected in the Table.

• Delete - To remove any parameter, select the parameter to be deleted and then click the 'Delete' Button.

• After adding or modifying or deleting the parameters click the 'Finish' Button. • A dialog that the <ClassName.nar > has been created at the < Destination Directory>

will be prompted. • Click the OK button to exit from the wizard.

Note : If you want the Application to be specific to the host from which it is invoked, change the value of 'HOST' as HOST = ${name}.

Page 214: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 213

8.17 Integrating Tools into IDE

8.17.1 Configuring Tools Tool configuration helps us to run any tool from Bean Builder. The user can run the tool from Bean Builder by giving required commands in the Tool Configuration dialog. Select Tools --> Configure Tools menu-item to invoke Tools configuration dialog as shown below.

In the dialog shown above , you can specify all the information that is necessary to run the tool from the Bean Builder.

• Enter the tool name in the Menu text-field. • In the section for Command, enter the command that is necessary to run the tool. Ensure that

you do not remove the "$" and "%" symbols as the Bean Builder uses these to replace the filename, CLASSPATH .. etc.

• Append the Variables as required. o The JAVA_HOME takes the location of the JAVA_HOME directory. o FILENAME is the name of the source file along with its full path that is currently open

in Bean Builder. o DIRECTORY is by default <Web NMS Home>/Projects/<your project>. o CLASSPATH is the classpath of the current screen. o CLASSNAME is the classname without the .class extension o SCREEN_NAME is the name of the current screen. o PROJECT_FILE is the project (.proj) file.

• Specify the execution details as per your requirement.

Page 215: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 214

The user can view the configuration details in Tools.config file under the <Web NMS Home>/builderconf directory. The Auto-Execute options in the Tools.config file can be interpreted as follows :

• "0" refers to "No Auto-Execute" • "1" refers to "After Source Generation" • "2" refers to "Before compilation" • "3" refers to "After compilation".

Usage Consider the following examples

Case1

run Netscape from the Bean Builder

• Enter the tool name as NetScape • For command, enter "netscape $%FILENAME%$". • You can set the Auto-execute Options to be "No Auto Execute". Clicking on "Ok"

adds "Netscape" to the Bean Builder "Tools" menu. Now, you can run Netscape from the Bean Builder itself to view the current file.

Case 2

run "javap"

This lists all the public methods and public variables.

• Enter the tool name as "javap". • For command, enter "javap $%CLASSNAME%$". • Set the Auto-execute Options depending on your requirement. • Clicking on "Ok" adds "javap" to the Bean Builder Tools menu. • Now, you can run "javap" from the Bean Builder itself to view the public methods and

public variables.

Page 216: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 215

8.18 Configuring Servers

8.18.1 Features in Servers UI

Server Configuration The server that is packaged with Bean Builder is the Web-Server, which is started automatically when an applet or panel or frame is run. The Web- server can also be started manually from the servers UI invoked through Tools --> Servers icon. The web-server used in AdventNet Bean Builder can be configured as desired by the users in two ways. 1. From the Launcher double click on servers to open up the UI shown below. 2. From the Tools menu of Bean Builder IDE, select Start Servers . This brings up a UI that can be used to configure the server as shown below.

• Select the server and press the Start or Stop button to perform the corresponding function. • The server can be started at a desired port. • It can be automatically started. • Debug message can be seen. • To reflect the settings every time the Bean Builder is started, "Save" button should be pressed

after making the necessary settings.

Page 217: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 216

Tom-Cat Server (Web Server)

The Tom-Cat server is packaged with Bean builder for testing the applets that are built using Bean Builder. The Server is started automatically by Bean Builder while running the applet. The user can start and stop the server whenever needed. After building and testing the whole project, the user can deploy the project under any Web-server.

Severs.Config

The Servers.Config is the main file which has entries about the server that is packaged with Bean Builder. This file has entries like

Debug - to inform whether the server supports debugging option. Its false by default. ClassName - To inform the main class of the server and this class must be in ClassPath. ServerName - A visual name which is shown to the user as server name. Port - The Port at which the server is started. AutoStart - This option has to be enabled to start server automatically while launching the server tool. A typical entry for Web Server will be as given below:

<Server> <property name="Debug" value="false"/> <property name="ClassName" value="com.adventnet.builder.server.TomcatServerInfo"/> <property name="ServerName" value="Web-Server"/> <property name="Port" value="9191"/> <property name="AutoStart" value="false"/> </Server>

AutoStart :

Auto start option is useful to start the server automatically while launching the server tool from the Launcher or Bean Builder IDE. By default the autoStart option is disabled. If the user would like to change it, he can modify it and save those changes. So next time when the user starts the servers UI, the corresponding server will be started automatically.

Debug Option:

Debug option is used to debug the queries received by the server and also the response sent by the server.

Starting Servers Individually

To start Tom-Cat server individually without UI, batch and shell files are available in the <Web NMS Home>/bin directory.

To add a new server to the servers UI, refer the topic "How to add new server".

Page 218: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 217

8.18.2 Adding a New Server You can customize the Servers UI to add your server to the already existing web-server. Adding a new server has 2 steps.

• Writing a ServerInfo.java file for that server and • Adding an entry for that server in the Servers.config file

Writing ServerInfo.java A typical serverInfo is given below. You have to write your own code for starting and stopping your server as given below. /*$Id: MyServerInfo.java $*/ package com.adventnet.builder.server; <import needed for my server> public class MyServerInfo extends ServerInfo { public MyServerInfo() { if(getPort() == -1) setPort(portno); setAutoStart(false); setStatus(false); } public void startServer() { <code to start your server> setStatus(true); } public void stopServer() { <code to stop your server> setStatus(false); } public String getServerName() { return "My-Server"; } public String toString() { return "My-Server - "+ getPort()+" - "+getRunning(); } public void setDebugOptions(boolean debugArg) { } }

Page 219: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 218

Editing Servers.config file The Servers.config file present in <Web NMS Home>/builderconf directory should be edited to add a new server. Append your own server entry between the start and end tags of <Servers> as shown below: <Server> <property name="AutoStart" value="false"/> <property name="ClassName" value="your server main class name (It should be in classpath)"/> <property name="ServerName" value="My-Server"/> <property name="Debug" value="false"/> <property name="Port" value="9191"/> </Server>

Page 220: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 219

8.19 Migration Guide

8.19.1 Migrating the project Projects developed using previous releases of Bean Builder (4.2.2) as well as that of the Management Builder (Release 4.1.1 to Release 4.3 ) can be opened using the Bean Builder 4.4 after migration. The process of migration is necessary to convert the files used by the project to the latest version. In order to simplify the conversion of older version projects to the latest version the Migration Wizard tool is provided. The Migration Wizard can be invoked using the BeanBuilderMigrationWizard.bat/sh file that can be found under the <Web NMS Home>/bin/developertools directory. Steps involved in Migration

• Conversion of the Project, Screen and Source files • Source Generation & Compilation

Migration Support

• All Projects developed using Bean Builder Release 4.1.1, 4.2 and 4.3 can be migrated to the latest version (Release 4.4).

Resources that are converted

• <YourProject>.proj file • Screens under <YourProject>/Screens directory • Source files under <YourProject>/Source directory

Setting up resources for Migration Jars required by the project(s) of older version , which are not available with the current version, need to be copied to the <Web NMS Homw>/classes directory and added to the CLASSPATH. Projects made with previous releases of Management Builder tools can also be migrated. The extra resources such as MIBs are automatically copied into the migrated project. But when the project is opened in Bean Builder Release 4.4, the Management Builder related information will not be shown by Bean Builder. However the information will be retained and can be seen when the project is opened using the appropriate tool. Using the Migration Wizard - Step by Step procedure Conversion of the Project File and the Screen Files

• Start Migration Wizard from the Web NMS Launcher or by using BeanBuilderMigrationWizard.bat/sh from the <Web NMS Home>/classes directory.

Page 221: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 220

• The first screen of the Wizard will ask for the 'Project File' (.proj). • Browse and select the .proj file of the project that needs to be migrated. • Click "Next". • The next screen will list the 'Resources Used' as shown below.

• Click "Next". • The next screen asks for the directory under which the converted project needs to be copied

to. (By default, it is the projects directory of the latest version of the Bean Builder)

Page 222: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 221

• In case you need to change the destination directory, o Browse and specify the complete path for placing the converted project. If the

directory does not exist, then the directory/directories will be created. o It is preferable to copy <YourProject> folder and <YourProject>.proj file from the

directory you have specified in the projects directory of the Bean Builder and then open the project.

• Click "Next". • Regenerate Source: This will generate the source files for the project. CLASSPATH settings

for generating the source can also be specified here.

Page 223: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 222

• Custom Classpath : This can be customized by the user to add to the classpath any files

that are required during regeneration of source for the project. o An additional entry can be made to the Custom Classpath by using the Browse

button. o When the file chooser comes up after clicking on the Browse button select the .jar,.zip

file or the directory that needs to be set in the CLASSPATH and then click on Open. o To remove an entry from the CLASSPATH or change the order in which classes need

to be placed in the CLASSPATH select the entry and use the Remove button and the buttons with the arrow marks respectively.

• System Classpath : This classpath cannot be customized and is the classpath of the Bean Builder tool at start up.

o You can scroll down through the entries in the System Classpath for reference. • The next screen will have a Log display. This screen will also ask where and in which file the

Log Messages should be saved. Saving the log messages to a file is optional. • Click on the "Convert" button. • You will see the conversion messages on the Log output and a message whether the

Conversion has succeeded. You can refer to the log window for details on what the reason for failure of conversion is and how to solve the same.

• If needed click on the "Log to File " button to save the contents of the Log Output to the specified Log file

• On Successful conversion, the Project is ready to be loaded in Bean Builder

Page 224: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 223

Compilation of the source files

• The next screen helps to compile the generated source

• If you want to add an entry to the CLASSPATH then click on the Browse button. • In the File chooser that comes up select the .jar,.zip or the directory that needs to be added to

the CLASSPATH and click Open. • To remove an entry from the CLASSPATH or change the order select the entry and use the

Remove button and the buttons with the arrow marks respectively. • Click "Next" button. • The next screen will display the Log messages for Compilation as shown below:

Page 225: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 224

• Click Finish to complete the compilation. • On Successful compilation, the Project is ready to be run from the Bean Builder

Migration in ProListView Bean There are a few changes in the ProListView bean from Bean Builder 4.4 Beta to Bean Builder 4.4 release. They are as follows. The table model for ProListView, com.adventnet.beans.probeans.ProListViewTableModel, is changed to com.adventnet.dmp.model.table.RCTableModel. This change is to make the model generic. The methods that are changed are listed below.

Old Method Replacement Method void dataSort(int sortColumn, boolean isAscending) void sort(SortColumn[])

java.util.Vector getColumnNames() TableColumn[] getTableColumns() java.util.Vector getFirst() boolean first() int getFromIndex() int getStartIndex() java.util.Vector getLast() boolean last() java.util.Vector getNext() boolean next() int getPageLength() int getFetchSize() java.util.Vector getPrevious() boolean previous() int getToIndex() int getEndIndex()

Page 226: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 225

Old Method Replacement Method int getTotalCount() int getFetchSize() java.util.Vector refreshModel() void refresh() boolean setFromIndex(int fromIndex) void setRange(int,int) boolean setPageLength(int pageLength) void setFetchSize() boolean setToIndex(int toIndex) setRange(int,int) boolean setViewRange(int fromIndex, int toIndex) void setRange(int,int)

The methods that are removed are listed below.

Removed Methods Reason for Removal int[] getDataSortIndexes() java.util.Vector getDataVector() java.util.Vector getFirst(int num) java.util.Vector getLast(int num) java.util.Vector getNext(int num) java.util.Vector getNext(int num, boolean sameStart) java.util.Vector getNext(int fromIndex, int pageLength) java.util.Vector getPrevious(int num) java.util.Vector getPrevious(int num, boolean sameEnd) java.util.Vector getRow(int index) int[] getViewSortIndexes() java.util.Vector getViewVector() boolean setColumnNames(java.util.Vector columnNames) boolean setDataVector(java.util.Vector dataVector) void setNextEnabled(boolean nextEnabled) void setPreviousEnabled(boolean previousEnabled) boolean setTotalCount(int totalCount) boolean setViewVector(java.util.Vector viewVector) void viewSort(int sortColumn, boolean isAscending)

These methods are removed to make the model more generic.

boolean isNextEnabled() boolean isPreviousEnabled()

The isFirst() and isLast() methods are sufficient to achieve the same requirement.

Page 227: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 226

8.19.2 Troubleshooting in Migration Wizard For details on the procedure of Migration kindly refer to the Migration Guide. API changes and other updates in 4.4 After converting your project(s), you will be able to successfully "Compile and Run" the converted project(s) in Bean Builder. The Bean Builder tool takes care of converting all the resources of the older version so that it is made compatible with the latest one. The Tool does not modify the code written by the user. So the user will have to change the "User Defined Code" if there are any API incompatibilities. So after conversion, you can open your project using the latest version of the tool and compile the same. If you have added some of your own code, that too using any of the changed API(s) only then there is the possibility of a minor problem and you may not be able to compile your project successfully.

Note : User Code added in the Screen properties form of the previous releases will be available and can be added directly in the "Source" tab. For more details of how to edit the source in the Source tab kindly refer to Editing Source Files.

Problem with old version project : Make sure that the project was successfully compiled and the required output was obtained while using the older version. Dependency on other classes: If source is being generated for a screen that has other screens/classes dropped in it, the classes for the screens dropped inside need to be present in the CLASSPATH for successful Source generation. This is done by adding the classes directory of the project being converted to the CLASSPATH. Make sure that the project classes are present inside the classes directory of the project being converted so that no problem occurs. i.e., all the old class files should be present in the <Bean_Builder_Old_Version>/projects/<yourproject>/classes directory before migration. Project built using the Configuration wizard of Client Builder: If you are migrating project built using the Configuration Wizard that is used for Configuration Management then you need to do the following steps :

• Add the following entry in the <Web NMS Home>/builderdata/PropertyEditors.list file. com.adventnet.beans.configuration.ConfigSnmpDevice =

com.adventnet.beans.configuration.ConfigDeviceInfoEditor

• Include the jar that contains the above classes in the CLASSPATH of the Migration Wizard after copying them to the jars directory of the latest BeanBuilder.

• Invoke the Migration Wizard and then migrate the project as usual. Problems due to the customization of source generation templates

• If you have already customized the Application Template.tpl to meet your needs such that the main method has been changed (code added/removed) and if you replace the already existing template under the <Web NMS Home>/builder_template directory or as a project level template, you will encounter source generation problems after migration. Error message like "Source Processor : The tags are corrupted. Blocking of source could not be done" will be thrown.

• If you have customized the NMSPanel source generation template and if you have added any method in the InnerClass part of the template (like setProperties() method of the AbstractNmsPanel) you will have problems (duplication of the setProperties() method). You must copy your template to the project's template directory to solve this problem.

Page 228: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 227

• If you have added your own setProperties() method in old screens then you will not be able to compile your source as there will be a duplication of the same after source generation.

This document can also be accessed directly from the Migration Wizard by clicking on the link as shown below. This link will be available in the bottom most part of the Log Area.

Page 229: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 228

8.20. Introduction to Tutorials Tutorials are developed to help you understand the usage of Bean Builder and other components associated with the same. These give you an in-depth understanding of the functionality. The step by step procedure to build a simple application is explained in the Building a Sample Application tutorial. A first time user of the Bean Builder can go through the same and learn all the basic functionality of the tool.

Page 230: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 229

8.20.1 Building a Sample Application This tutorial guides you through the steps that are to be followed for building a simple application using the Bean Builder Integrated Development Environment. This tutorial assumes that the Bean Builder is installed in your machine without any problems and that you are able to successfully launch the "Bean Builder" using either the "Web NMS Launcher" or the script file. If you face problems invoking the IDE, please refer to our comprehensive documentation provided here. This tutorial helps you to build a project, which has a text area and two buttons. When you press a button, the specified text is printed in the text area and the other button is used to clear the contents of the text area. This can be achieved in five steps.

• Step 1: Creating a Project for the application. • Step 2: Creating a new Screen (UI) file for the application. • Step 3: Laying out necessary components in the screen. • Step 4: Setting Bean properties. • Step 5: Creating connections between bean components. • Step 6: Compiling and Running the project.

The source code for the project, which can be directly loaded in the Bean Builder, is bundled here as demo_project.zip. Extract the zip file over <Web NMS Home>/projects directory and then from the Bean Builder select File --> Open Project menu item and select the Demo.proj file. You can see the screen and the code. You can Compile and run the project to see the output.

Page 231: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 230

8.20.1.1 Step 1: Creating a Project The first step towards building an application is to create a Project for the application. Follow the steps given below to create a new project.

• Invoke the Bean Builder. Choose "File -> New -> Project" menu item from the menubar to invoke the "Project Details" dialog. Optionally, the dialog can be invoked from the "ToolBar" using the corresponding button. (Button image here).

• The project details dialog takes in details like the "Project Name" and the default "Package Name" for the files in the project. Let us for example create a project by name "Demo" with a package say "test". Please enter the details as shown in the UI below.

• Now click on the "OK" button to successfully create the project. This can be confirmed if a tree node named "Demo" is added under the "Projects" tree node in the Tree that is shown on the top left corner of the Bean Buider frame. This tree is termed as the "Project Tree" in Bean Builder.

Note : All the project related information is stored in a file named "<Project Name>.proj", where <Project Name> refers to the name set for the project. This file is placed under the "<Web NMS Home>/projects" directory. Also a folder with the "<Project Name>" is created here to store the project related resouces.Choose "File -> Open -> Project" menu item to open an already existing project.

Page 232: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 231

8.20.1.2 Step 2: Creating a Screen After creating a project our next step is to create the UI (application). Choose "File -> New -> Screen" menu item from the menu to invoke the "Screen Builder". Optionally, the dialog can be invoked from the "ToolBar" using the corresponding button. (Button image here).

The Screen Builder is a tool which can generate pre-defined UIs. The screen that is to be built can fall under any of the Types shown in the image above. The default Type is "Application". The pre-defined UIs can be generated by following the steps taken through by the wizard. The user can also "Finish" at any point of time as per his requirement so that the options specfied till then would be used for screen generation. Being a simple example, lets finish at this first stage itself by clicking on the "Finish" button. By doing so, the following screen (plain) is generated for us with a name "new_screen1". The corresponding class generated also has the same name.

Page 233: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 232

You can double click on the tree node to rename the screen name and effectively the class name. Lets rename the screen as say "DemoApplication". This happens once you press the "Enter" key after entering the required name for the screen. The undo the "Edit" action, press "Escape" key.

Thus a new screen is created under this project. The Meshed area that you can see on the right hand side of the window is know as the "Draw Area" which is used to Layout the necessary components.

Page 234: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 233

8.20.1.3 Step 3: Laying Out the Components Once a new screen is created, we can see a Meshed area know as the "Draw Area" on the right hand side of the Bean Builder window. This area is used for laying out the various components that are be presented in the UI. The various components that can be used in the screens are presented above the draw area and is know as the "Bean Palette". The various "jars" that contain the components are presented as tabs above the draw area. The users can select the components by selecting the "Tab" (jar) in which it is present. (image here). Before placing the components in the draw area, it is important to choose a Layout for the screen. By default, a "NullLayout" is set for the screen. user can select his own layout by right clicking on the draw area and invoking any one of the layouts as shown below. Let us set a "BorderLayout" for our application.

All the basic swing components, viz. JButton, JLabel, JComboBox etc. are present in the "SwingBeans.list" tab. To use a particular bean, just click on the corresponding button in the "Bean Palette" and click on the "Draw Area". Once you click on the button in the Bean palette, the Mouse

Page 235: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 234

pointer changes to a "Hand" cursor accompanied by the bean representation (icon) which disappears when we drop it in the draw area. Let us develop an UI which has a TextArea and Two buttons layed out as shown below. When you click the first button, the desired text must be printed in the screen and when you click the second button, the displayed text must be cleared. Follow the steps given below to layout the components as shown in the figure.

1. Drop a JTextArea and a JPanel from the Bean palette. 2. Drop two JButtons from the Bean palette onto the JPanel that has been dropped in step 1. 3. The properties can be set by invoking the "Layout Properties" menu item from the popup

menu that appears when we right click on the screen.

Thus you have got the components in the screen. Now you must change the properties of the beans and establish connections between them to achieve the final requirements.

Page 236: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 235

8.20.1.4 Step 4: Setting Bean Properties Our next step would be to set the various properties for the UI components. This can be done by invoking the "Property Editor" which pops up when we double click on a bean (say a JButton). The other way to invoke the Property editor is by right clicking on the respective component and invoking the "Property Form" menu item from the popup menu. The text namely "Populate" and "Erase" for the buttons are set using this property editor as shown below.

The instance name of the components can also be modified using this editor. You can also write custom java code related to the Bean by clicking on the "Custom Code" tab as shown below. The code that is written here will be merged with the main source code during the regeneration process.

Page 237: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 236

When you set the setOpaque() method to true, the button becomes non transparent and so you can set background and foreground colors for the same.

Page 238: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 237

8.20.1.5 Step 5: Creating connection between beans Once the components are layed out, our next step is to setup connections between the components. When you click one button, some text has to be printed in the text area. To achieve this the button and the text area must interact. i.e. you must write the connection code. This can be done by right clicking on the component that would be the source of the event and invoking any one of the items as shown below. Here, let us create an ActionEvent between the JButton and the JTextArea.

Page 239: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 238

Once you select the "actionPerformed" menu item, you will get to see a rubber band kind of representation travelling with the mouse as shown below. Move the mouse pointer on top of the destination component (JTextArea in this case) and Left-click the mouse.

Page 240: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 239

This will invoke the "Interaction Wizard" which is used for creating connection classes.

Page 241: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 240

The type of the connection class (Anonymous, Inner or Separate) can be selected from the second screen of the wizard.

Page 242: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 241

Navigate through the wizard to the Final screen and type in the code that has to be executed inside the "actionPerformed" method as shown below. If the connection class is opted to be of type "Separate", the class is compiled when we click on the "Finish" button and errors if any are also reported.

Page 243: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 242

The list of connection classes created in the screen is also displayed in the bottom left tree under the "Connections" node.

The source generated from the screen developed and the connection between beans can be viewed and edited in the source tab (JMacs editor) in the Bean Builder. You can edit the code that you had written in the interaction wizard screen in the editor also.

Page 244: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 243

Editing the Source The code related to the UI that has been developed so far is generated by the builder automatically. The code that has been generated can be viewed by selecting the "Source" tab present below the draw area. The builder generated code is marked by "//<Begin..." and "//End..." tag as shown in the figure below.

Users are not advised to edit their code with in these tags. Users can plugin their code either above the "//<Begin.." tag or below the "//<End..." tag. The user code will be removed automatically during the next regeneration process of the builder when placed with in these tags.

Page 245: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 244

8.20.1.6 Step 6: Compiling and Running the project Before compiling the project, the classpath and other properties like the "Run setup", "Compilation options" etc. must be set. It can be done using the "Project Properties" dialog that pops up when you press the F12 button or activate the "Project Properties" menu item from the "Properties" menu.

Please go through the Help documentation for more details how the various options can be configured. Now, you are set to compile the screen that is being built. Choose the "Build -> Compile" menu item to compile the screen. Compilation errors if any will be displayed in the Status window automatically. After compilation, use the "Build -> Run" menu item to run the application. Both compilation and running can be done on a single step by using the "Build -> Compile and Run" option. The default output that would appear is shown below.

Page 246: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 245

If you click on the "Populate" button, the following output should be seen. The UI can be brought back to its initial state by clicking on the "Erase" button.

Thus you have developed a complete application using the most frequently used options in Bean Builder. For further details on a particular section / operation / feature please refer to the corresponding section in this documentation.

Page 247: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 246

8.21 Frequently Asked Questions The frequently asked questions in Bean Builder are listed here. 1. When I drop screens/classes as beans using the “ProjectClasses” tab, some of the dropped screens get displayed as a NonUIBean whereas I am able to see all the components of some screens. What could be the possible reason? It is not possible to add a Top Level container like Frame into another Top Level container. You can add other components like panels into these Top Level containers. If the screen you drop is a Top Level Container (Build Types are Frame, Application (extension of Frame),dialog or NMSFrame) then it will be dropped as a invisible bean. However if the screen is of a type that can be added into a Top Level container (Build Types Panel, NMSPanel) then all the components will be visible. 2. What is the order in which the classpath will be set for a project/screen that is getting compiled? The order of CLASSPATH for compilation is taken from the “Classpath Settings” tab of the “Project property Form”. It is as follows :

• Values corresponding to ClassPath will be first. (You can change this order and it will be maintained).

• Values corresponding to Containing Jars are second. (You can add jars to this entry but the order will be changed as the tool automatically updates the jars required by the project in this field only).

• If “Append Builder Classpath” is selected then this is added finally (third in order) to the CLASSPATH.

3. A couple of questions on the “Override old class” option in the “Load Jar” dialog.

3.a. Does the option override the same class if it is found in a jar with a different name? No. Only if the class is found in another jar with the same name the new class will have effect. 3.b. If I have used the option and now I drop a bean from the old jar (whose classes have been overridden) will the bean reflect the old jar’s class or the class from the latest jar that was used to override the old class? It is the latest jar’s class that will take effect.

4. What does the “Append Builder Classpath” option in the “Project Property Form” do? This adds all the classes that are present in the Classpath of the Bean Builder tool at startup to the Classpath of the project. 5. Can the applications created using the AdventNet Bean Builder be integrated with the AdventNet Web NMS? Yes. Applications of Build Type a NMSPanel, NMSFrame and Applet can be created into a NAR. The Package Wizard can be used for the same. The created NAR can then be integrated into the WebNMS using the “Nar Installer” packaged along with the WebNMS.

Page 248: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 247

6. Can I run/use the applet I developed using the AdventNet BeanBuilder exclusive of the BeanBuilder or WebNMS? Yes. The applet can be directly run using JDK’s “appletviewer” or a standard Browser. The html file required to run the applet will be found under <YourProject>/html directory. You can achieve the same after deploying the project. The usage for the same is a appletviewer <html file>. 7. Can I use Bean components developed by someone else? Yes. The Bean Builder accepts beans that conform to the standards of a Java's BDK. If the Beans are available in the form of a jar then you can use the “Load jar” option and load the jar to make the beans available in the Beans palette. 8. Can I modify the generated code or add some functions and recompile it? Yes. You can add your own code and functions to the already generated code and compile the same. However the following point must be kept in mind while doing so. You can add your own code either between //<UserCode_Begin_...> and //<UserCode_End_...> tags or outside the //<Begin_...> and the //<End_...> Tags. Otherwise it will get lost when you regenerate the source (This also implies that you should not modify the Bean Builder generated code that is found within the //<Begin_..> and //<End_...> tags). 9. How to generate debug message for my Application built with AdventNet Bean Builder? As of now builder does not support application debugging. But you can debug the application using java's jdb. jdb debugging support from builder is available at the location ProjectProperties --> debug --> jdb. You can enable this and run the application. The status window will enable the command prompt for jdb debug. You can use the jdb commands in the status window for debugging. 10. When I tried to compile my project, I got this error message "You would need java compiler for this operation" -- What should I do? You might have running the builder using JRE. You need JDK to compile the files generated using builder. Please check whether you are running the tool with JDK in path and tools.jar of JDK is in classpath. 11. In replace bean some beans get replaced and some does not. Why? If the bean that is present there has a layout (like JPanel) and if the bean that is replaced does not a have layout (like JButton). Then you cannot replace the JPanel with JButton due to incompatibility in their layouts. 12. In Layouts the slight shaking of component changes the component position completely, how to overcome this? Use the Cascade Lock Option, to lock the containers that you have already positioned. This will lock all the components in the container. 13. How do I resize a component in layout? Resizing of components is allowed only in Flow Layout and in Border Layout. For more details regarding this refer documentation. 14. Is it possible to merge the projects together? As of now there is no tool to merge two project into a single project. But Builder supports CVS versioning system. So two users can work on the same project simultaneously and check in the source to the same CVS repository to be in sync.

Page 249: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 248

If you have two project that are independent and if you want to merge those two projects into a single project, then you can manually do that. Fist copy all the screens,source and classes of the first project to the second project (Note: Please make sure there is no duplication of the same screen name in both the projects while copying). Then update the containing jars entry of the project. Also take care of updating other project related entries into the merged project. 15. How to Internationalize your Application in Bean Builder? Invoke the Project Property form --> Source Generation --> Internationalize the source. Check on this option (Note :By default it is un checked). Then if needed change the locale properties to get the properties file with your locale extension. Then regenerate the project. 16. How to Dynamically pass Parameters to sub screens or how I can dynamically change parameters in my project? For Application type you can pass arguments. But this arguments will take effect only for the first time initialization. If you want to change the parameters dynamically across subscreen that are invoked from main screen, then you can do that by selecting the option available in Project Properties. To achieve this

Step 1: Invoke the Project Property form --> Source Generation --> Dynamic Parameter Change Needed and check this Option (Note :By default it is checked) Step 2: Make all properties that need to be dynamically updated as getParameter(). For example if you want the HOST to be set in a text field dynamically then in the setText property of the text field change the property to getParameter("HOST") Step 3: Go to the Main Screen. Step 4: Create a properties Object and put the property value for the HOST parameter in that property object. Step 5: pass the property object to the setProperties() method.... The code will be like given below

Properties p = new Properties(); p.put("HOST",JTextField1.getText()); setProperties(p);

This will help you to see all the properties dynamically changing at run time. 17. How to specify your own constructor for a bean instead of default constructor at runTime? By default for all beans the source generation will be invoking its null constructor or its applet constructor. If a bean named ListPanel is dropped in builder it will have the source to be instantiated like

ListPanel = new ListPanel() or new ListPanel(applet)

If you have a constructor like new ListPanel(Obj) then you can change the source to be generated with the constructor you want. To achieve it:

Step 1: Invoke the bean property form. Step 2: find the property name called initializer in the property sheet. Step 3: specify the initializer here as new ListPanel(Obj) (Note: By default it will be empty constructor or applet constructor). Step 4: Now close the property sheet and go to the source tab. Step 5: you can find the source in the source tab as given below.

ListPanel1= new ListPanel(obj);

Page 250: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 249

18. How to specify the access modifier to Beans? By default the beans that are dropped in Draw Area will have package level access i.e.., If a JButton bean is dropped in builder it will have package level access as given below.

javax.swing.JButton JButton1 = null; You can change this package level access modified to private, public or protected as you need. To achieve it:

Step 1: Invoke the bean property form. Step 2: find the property name called modifiers in the property sheet. Step 3: specify the modifier here as private or public as you need (Note: By default it will be empty). Step 4: Now close the property sheet and go to the source tab. Step 5: you can find the source in the source tab as given below.

public javax.swing.JButton JButton1 = null; 19. How can I configure the various Look & Feel standards for the applications developed in Bean Builder? The UI that are built using Bean Builder can be made ALF compliant by selecting the Look And Feel as "AdventNet Look and Feel" in the Project Property Form. i.e. in "Properties menu --> Project Properties --> General --> Look and Feel Standards". The components dropped thereafter will follow the ALF standard. Alternatively the Look and Feel can also be defined by the user. For example assume that a user is developing an UI in which he wants to have some default properties set on the components, so that whenever he drops it from the palette the properties will be set by default. If the user wants to have his/her own standards for a particular component, say a JButton, first he has to select the "User Defined Look & Feel" in the Project Property Form . i.e. in "Properties menu --> Project Properties --> General --> Look and Feel Standards". Then if he wants to have all the buttons with foreground color red, he has to drop a JButton and set the foreground property as "Red" in the Bean Property Form (which can be opened by double-clicking on the bean or by navigating through "Properties menu --> Bean Properties"). Now, right clicking on the Jbutton and clicking the "AddToStandards" pop up menu will save the standards in a file specified in the Project Property Form. After doing this, whenever the user drops a JButton from the palette, it will have the foreground property (red) set on it. Thus the user needs to set the properties once and saving it to the standards will set the properties on the further dropping beans. If the user does not want any Look and Feel to be set, he should choose "None" in the Project Property Form. ("Properties menu -->Project Properties -->Look and Feel Standards"). 20. Can i invoke other tools from bean builder? Yes, other tools can be invoked from bean builder. step 1: In the tools Menu select Configure tools (Tools --> Configure Tools). Tool Configuration dialog is invoked. step 2: In the Tool Configuration dialog

a) In the Menu text field enter the tool name (it can be any text. This text will be set for the menu item that will be added in the Tools menu) e.g. : SmartJar

b) In the Command text field enter the command which will invoke the tool. Example:

for windows C:\AdventNet\BeanBuilder\bin\startSmartJarWizard.bat for Linux sh /home/guest/AdventNet/BeanBuilder/bin/startSmartJarWizard.sh

step 3: press OK. A menu item of the name given in the Menu text field of Tool Configuration dialog is added in the Tools Menu.

Page 251: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 250

step 4: Select the new menu item added in the Tools Menu. Smart Jar wizard will be invoked. Any number of tools can be configured to start from Bean Builder , by clicking the new button in the Tools Configuration dialog. 21. Can i override the statements inside the begin end tags in a method generated by bean builder ? Yes, the statements inside the begin end tags in a method can be over ridden as explained in the code snippet below . public void setUpProperties() { JButton2.setText("OK"); if(false) { //<Begin_setUpProperties()> try { JButton2.setFont(new Font("SansSerif",0,12)); JButton2.setHorizontalTextPosition(4); JButton2.setText("test"); } catch(Exception ex) { showStatus("Exception while setting properties for bean "+JButton2,ex); } //<End_setUpProperties()> } 22. How can i set a project parameter which can be accessed across all the screens of the project? The project parameters can be declared as follows

1. Open the project properties form 2. In the General tab, click the button next to Project Parameters Combo box. Project

Parameter dialog list appears. 3. In the Project Parameter dialog the project parameters can be given.

example: name_param=john 4. The variable host can be accessed any where in the project using the getParameter(String)

method as follows example: String name = getParameter("name_param");

23. Can i set the values received from project parameters as values for bean properties in Bean Property Form Yes, the project parameters can be set as values for bean properties in the Bean Property Form as explained in the example below

1. Drop a JTextField on to the screen. 2. In the Bean Property Form of the JTextField select the text property. 3. Invoke the Advanced Property Editor by clicking the button the text property. 4. In the Advanced Property Editor, type the parameter name in the textfield. 5. Select Project Parameter in the combo box . 6. Now press OK. close the property form. Compile and run the screen .

The value of the given project parameter will be set in the text field during run time.

Page 252: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 251

24. Is it possible to start Bean Builder loading some projects by default ? Yes. Follow the steps below.

1. Invoke Global properties (F2 / Properties -> Global Properties) 2. Browse the list of projects to load (.proj file's) and give it in "Projects to Load". 3. Exit the BeanBuilder and start again. 4. The given projects will be loaded by default.

25. Is it possible to get warning, verbose deprecated messages in Bean Builder while compiling? Yes. Follow the steps below.

1. Invoke the Project Propertyform(F12 / Properties -> Project Properties) 2. Go to the Compilation tab. 3. Check the check boxes given for various options. 4. Compile a screen. 5. Output can be seen according to the selected options.

26. How to get javadoc help in the Bean Builder editor?

1. Go to the editor part of Bean Builder. 2. Right click on it and invoke the preferences. 3. Go to the Help Setup tab and give the javadoc location path. 4. Click ok. 5. Type JButton in the editor and select it. 6. Then right click on it and click Help. 7. Help for JButton will be invoked in the browser.

27. How to change the look and feel for my screen in BeanBuilder ? In Screen properties form (F4 / Properties - > Screen properties). Select your look and feel from Look and Feel combo box and click ok. 28. How to change default size of a Bean dropped from the Beans Pallete ? Go to Properties menu >> Global Properties, change the properties Bean Height and Bean Width to the size say 100x100 then this default size will be set to all the beans you dropped as the minimum size. 29. Does the application, which is developed using Beanbuilder, run in the same JVM as that of the Beanbuilder? No, Bean Builder uses different JVM .You can change the JVM for running your application through the Properties menu --> Project Properties menu --> Run Setup tab change the default jdk path in the Java Home text field .

Note: Bean Builder uses same JVM for compile the application, But this is not configurable.

30. Is it possible to make the Bean Builder toolbar as floatable ? Yes, Set the property "floatable" as true (by default it will be false) in the file <Web NMS Home>/builderconf/menu/BB_MenuFrame.xml.

Warning: Please take a backup of the file before editing the same.

Note: You have to restart BeanBuilder to the property to take effect.

Page 253: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 252

31. How to change the default properties set to a bean ? Go to Properties menu --> Project Properties --> General tab, in the " LookandFeel Standards" combobox select " UserdefinedStandards" close the dialog. Now drop some beans and modify the properties then select "Add to Standards" from the right click popup menu for each bean that you have been dropped. 32. How to save the error messages and log messages generated by Bean Builder ? Go to Properties menu --> Global Properties. In "Error Log File" and "Output Log File" fields the give file path where you want to save those messages and check the check boxes along with the text fields. 33. Is it possible to change the shortcuts for menu items in Bean Builder? Yes. You can change the shortcuts by changing the entries specified in <Web NMS Home>/builderconf/menu/BB_MenuFrame.xml file.

Warning: Please take a backup of the file before editing the same. for example ,

<MENU-ITEM name="Status Window" shortcut_key = "S" accelerator_key = "F8"> //Here the short cut changed as F8 by default it will be F7

Note: You have to restart Bean Builder for the property to take effect.

34. How can I pass Arguments for An Application?

1. Invoke Project Properties Form & Go to the RunSetup tab. 2. In the Application Arguments text field, enter your Arguments to be passed.

35. Is there anyway to change the package structure of my project? Yes. You can change your project package structure in the following way.

1. Invoke Project Properties form & goto the source generation tab. 2. In the Package Name text field, change the package name as per your wish. 3. If you want to create package structure for an already existing project also, you can follow

these steps. 36. Can I associate a popup menu for a bean and screen in the run time? Yes, you can. To achieve it follow the step below.

1. Right click on the screen & select Menus -> Create Menu in the screen popup menu 2. Screen Menu Configuration UI will be invoked. 3. Create a Popup menu & close the UI 4. Now select the screen and right click on it. 5. Go to Menus -> Popup Menus and select the popup menu you have created. 6. For a Bean, invoke the bean popup menu. select Popup Menus and choose your own popup

menu. 7. While running the screen, if you right click on the bean or screen, then the selected popup

menu will be present.

Page 254: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 253

37. How to get the line number in the exception thrown in status window while running a screen or project in BeanBuilder ? Go to Properties -> Project Properties (F12) In the ProjectProperties dialog go to the compilation tab and check the "Include Debug info" check box.

Compile and run the screen.

Now, if any exception is thrown, it contains the line number at which the exception is thrown. 38. How can I customize the properties displayed for a bean in its Property Sheet? You can categorize the bean's properties under different user defined groups. For this, you can create your own group and add the properties which are all to be listed under the group. The changes in any one of the groups will take effect in All Properties group also. Example:

1. Create a XML file with the name of the bean for which the properties are going to be grouped. (For e.g. HCellularGauge bean create a xml file with name HCellularGaugeBeanGroup.xml).

2. Now put the entries for group name & its values i.e., properties which are going to be present under the group.

3. Now update the corresponding BeanInfo.Jar file with the XML file (In this case update the AdventNetUIBeanInfo.jar).

4. In the Jar, the XML file should be present with the proper package structure. (AdventNetUIBeanInfo.jar/com/adventnet/beans/gauges/HCellularGaugeBeanGroup.xml).

Load the JAR in BeanBuilder and invoke the HCellularGauge Beans Property form to see the customized Property sheet. (Refer documentation for further knowledge). 39. Can I take a printout of source files which are opened in the Bean Builder? If your system is printer configured, then you can directly take a printout of the source files by invoking the "File --> Print File" option. The Bean Builder invokes the System properties for printing. 40. Can I customize the source generation process for screens of a particular project ? The source for dropped screens are generated from the pre-defined template files present under <Web NMS Home>/builder_template directory. If you want to have specific methods or comments for screens of a particular project to be generated automatically, you can place a copy of the template file inside the project's template directory and customize it to your needs. Whenever the particular screen is dropped for the project, source will be generated according to the customized template present in the projects template directory. If there are no files present under the project's template directory, the source will be generated from the default templates.

Page 255: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 254

8.22 Troubleshooting in Bean Builder Some of the troubleshooting tips in Bean Builder are listed below. The format of the document is: first the problem is stated and then its causes & steps to fix the same is explained. 1. Version mismatch between java and Configuration file Bean Builder maintains its own version of screens and Java files to avoid loss of Source and Configuration files. If java file version is not synchronized with the configuration file, a confirmation dialog pops up which asks for overwriting with current configuration file. Following are some troubleshooting tips.

Java File is Older than Configuration File If you have latest version of java file in some other directory, then press No in the confirmation dialog. Browse and specify the java file. The valid extensions for java file are "java","javabkup", "javabkup1", "javabkup~", "javabkupvc". Otherwise press yes to generate the java file in Source directory with reference to the current configuration file. A copy of the generated java file is placed in the tmpSource directory. A backup of current java file is placed in the Backup directory with ".javabkupvc" extension. Configuration File is Older than java File If you have latest version configuration file in some other directory, then press No in the confirmation dialog. Browse and specify the configuration file. The valid extensions for configuration file are "config", "configbkup", "configbkup1", "configbkup~", "configbkupvc". Otherwise press yes to generate the java file in Source directory with reference to the current configuration file. A copy of the generated java file is placed in the tmpSource directory. A backup of current configuration file is placed in the Backup directory with ".configbkupvc" extension.

2. Parsing error during Source Generation If a parsing error is encountered during source regeneration, then it is an indication of the presence of invalid characters or improper source format.

• Go to the source tab and check whether the user added code is entered below the version tag.

//<Begin_Version> //version$2 //<End_Version>

• Check your template files (project level or global templates). • Any invalid entries in the source file.

3. Builder does not accept package names If the package name is directly provided in the source tab, then during source regeneration the package name is removed from the source tab. The package name should always be specified in the Source Generation tab of Project Properties form. 4. Unexpected loss of source and configuration files. When you loose any source or configuration files, check the immediate backup in Project's Backup directory.

Page 256: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 255

5. NoClassDefFound Error while dropping screens. if NoClassDefFound exception is thrown while dropping screen (which has panel build type) into another screen, check whether the classes which were used in the dropped screen are present in the builder classpath (not only in compilation classpath of the project). Specify all the required jars or classes in Bean Builder environment file (setEnv.bat/sh). 6. IllegalArgumentException in WebNMS If two NAR (NMS archive) files are created with same names, one with NMS_FRAME build type and the other with NMS_PANEL build type, both the NARs will be installed in NMS. But when the installed NMS_PANEL NAR is invoked, an IllegalArgumentException is thrown. To avoid this, NARs should not be created for NMS_PANEL and NMS_FRAME with the same screen name. 7. Package Name problem while creating NAR When a new file is created for a project with a package name, and If it is attempted to be packaged as a NAR, the file is listed in the classes list without its package name. So the package name should always be specified in the Source Generation tab of Project Properties form. 8. Compilation error after deleting the bean If the compilation error is thrown after deleting a bean even though the source has been regenerated, check whether you have used the deleted bean instance in any of the custom code editing area either in the Interaction Wizard or in the screen menu configuration UI. This is because while deleting a bean the builder generated code only removed from source during regeneration. It won't remove the custom code that is added by you in the Interaction Wizard, Screen Menu Configuration UI or in any other bean properties form. So while deleting a bean, you have to manually delete the custom code which uses the particular bean instance. 9. Blocking done for builder generated code are collapsed in the source tab. The source code (.java file) may have ^M characters. Please remove the ^M characters from the source. This should solve the problem. 10. Unable to paste screen in another project If an error message is thrown while pasting a screen that contains other screens (classes) dropped as beans in another project, then do the following step. Copy all the missing classes which are listed in the error message in to the classes directory of the project in which the copied screen is being pasted. 11. Unable to start Bean Builder in Windows If you are not able to start the Bean Builder in Windows (by extracting zip archive), specify the correct java path in setEnv.bat file. 12. InnerClass Connection compilation failure and "class must be declared abstract"error In a screen containing inner class connections, if you see errors saying that class must be declared abstract and other errors pertaining to failure of compilation for the inner class then the problem needs to be fixed in the InnerClass code. Once the Inner class connection gets compiled successfully the screen(s) will also get compiled.

Page 257: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 256

You can refer to the Troubleshooting in Migration Wizard page for issues related to Migration.

Page 258: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 257

8.23. API Documentation API Documentation is meant for software developers, who use the components (like beans, etc.) to build their applications based on the APIs available in AdventNet Bean Builder. It contains the classes and methods pertaining to various components of AdventNet Bean Builder. Components: It provides APIs, of the reusable java components, for application development. The most significant components are

• Java Beans (compatible with any IDE) to build client applications. • XML based Menu and Toolbar framework to build comprehensive menubar and toolbar for

client UI. • Auto UI Wizard to develop wizards, which aid in application development.

Page 259: WebNMS Framework 5WebNMS Framework 5.0 :: Bean Builder ZOHO Corp. 6 8.1 Quick Tour 8.1.1 AdventNet Bean Builder Key Features: Fast Track Development. Separation of Development Focus:

WebNMS Framework 5.0 :: Bean Builder

ZOHO Corp. 258

8.24. Known Issues

Beans

• There are a few undesirable behaviours in the table view, of the ProListView bean, when you use sorting. They are: the row-selection will not be maintained after sorting and first time sorting of a column having the same value is erratic.

• In hilo, hilo open-close and candle charts, when multiple series of values are set, the number of the series in the legend is shown as 1, 3, 5, etc.

• With JDK 1.2.2, if you use the JSlider bean in your screen, this component will not be shown in the compiled screen.

Source tab (JMacs editor)

• Brace matching will be done over the commented braces also. • Sometimes when you are typing / deleting some characters in a line, the color of the line

changes. It occurs at some random positions, which is not definite.


Recommended