WebSphere Message Broker 8 Patterns

Part 1

INTRODUCTION

USING PATTERNS

SELECT A PATTERN

PROVIDE PATTERN PARAMETERS AND GENERATE PATTERN INSTANCE

Part 2

CREATE THE REQUIRED RESOURCES

DEPLOY AND TEST THE GENERATED APPLICATION

APPENDIX A: LIST OF PATTERNS PROVIDED BY WMB 8.0

Introduction

Time to market a product depends very much on the productivity of the development team. Overall productivity of a project depends on lot of factors including time spent on coding/configuring software, time spent on testing the product and fixing issues etc.

WebSphere Message Broker provides something called Patterns or «application templates» that can be used to build an application rapidly. A pattern is a reusable solution to a commonly occurring problem. Refer to Appendix A to know the list of built-in patterns available in WebSphere Message Broker 8.0. A pattern instancecan be generated rapidly from a pattern using the toolkit by providing the pattern parameters.

In the toolkit, a pattern instance is organized as a combination of a pattern instance project and message broker application. The message broker application is referenced by the Pattern instance project. The generated message broker application can be tested and deployed just like any other message broker application.

The built-in patterns are production ready and follow best practices. This helps reduce the cost of quality involved in the project. It is important to understand that patterns are not available for all scenarios and are only available for certain requirements that occur frequently.

Using Patterns

In this HowTo, We are going to use a simple built-in pattern called «MQ one-way (XML)» found under «Message Splitter» group in Pattern Explorer. This pattern helps in building a message broker application that receives an XML message from a MQ Queue, splits the message based on a criterion and routes the messages to different MQ Queues.

In Vega Water purifiers, the status of Annual Maintenance Contracts (AMC) of all the customers is reviewed everyday and a report is generated. The report provides a list of customers whose AMC is going to expire within a month’s time.

The Notification department accepts a message per customer. So the report pulled from Customer Information component needs to be split and the customer records are to be sent as independent messages to the Notification department. The Notification department sends out emails to the customers requesting them to renew their AMCs.

Select a pattern

Let us first select the required pattern from the list of built-in patterns.

  • In WebSphere Message Broker toolkit, Click Window menu | Show View menu-item | Patterns Explorer menu-item

In the Patterns Explorerwe can see the list of built-in patterns. The Message Splitter pattern is ideal for our requirement.

  • Click on «MQ one-way (XML)» pattern found under «Message Splitter» folder

A view titled «Pattern Specification» is displayed as shown below. In this particular case, the toolkit is not able to locate and use a web browser available in the machine and has opened the pattern specification outside the toolkit application. Read the pattern specification and confirm that the pattern is suitable for the requirement at hand.

  • Click «Create New Instance» button in the view titled Pattern Specification

A pop-up dialog prompts for a name for the Pattern instance. The Pattern instance is going to be just like any other Message Broker application. So follow the application naming conventions that you have in your organization.

  • Give a name to the Pattern instance, say «AmcExpiryRptSplitter»
  • Click OK button

Now the pattern parameters that are to be configured are displayed in the toolkit. The mandatory parameters are marked with an asterisk character.

Provide pattern parameters and generate pattern instance

  • In the Configure Pattern Parameters screen, Select «No routing» from Routing drop down

At this point, let us check the AMC expiry report that we are going to get from Customer Information component. This is also going to be the sample XML that we are going use to test the application (i.e. the Pattern instance).

amcExpiryReport xmlns:p=»http://www.themiddlewareshop.com/wmb8/vega/custinfo» xmlns:xsi=»http://www.w3.org/2001/XMLSchema-instance» xsi:schemaLocation=»http://www.themiddlewareshop.com/wmb8/vega/custinfo vega_custinfo.xsd «> 2013-01-15 customer id=»3828″> tom@mnosystems.com totalcare 2013-02-10 customer id=»3829″> bob@bptsystems.com ecare 2013-02-11

We want to create a separate message for every customer element in the report. Note that the customer elements are contained within the root element called «amcExpiryReport«.

  • Expand Input Information section
  • Enter the name of the MQ Queue that the application needs to check for input messages, say «custinfo.amcexpiry.in»
  • Enter the XML element that is the container for the elements that are to be split in the Container name field

If the element in the XML is namespace qualified, then the namespace can be given in full. For example www.themiddlewareshop.com/wmb8/vega/cust…

But if the XML uses just one namespace, then a wildcard character (asterisk) can be used to represent any namespace.

For example

*:amcExpiryReport

  • Enter the child element name (element found within the container element) in the Message element name field

Do not prefix an asterisk in «Message element name» field (i.e. *:customer in our example) to denote «any namespace» if you have provided it in «Container name» field. The «ExtractRecords» method in the ESQL file MessageSplitter.esql fails to identify the child elements with the name mentioned in Message element name field if you do so.

Since we have selected «No routing» option for «Routing» property in Input Information section, the Specify routes and Lookup routes controls are disabled. Also by default «Logging» is disabled, if required we can enable Logging feature.

  • Expand the section «No routing»
  • Type the output queue name in the «Output queue» text field, say «notification.amcexpiry.out»
  • Provide the Output queue manager name in Output queue manager field

The application that we are going to generate will route the messages to this queue.

  • Expand the «Error handling» section
  • Enter the name of a queue that we are going to use as the error queue for the application, say «notification.amcexpiry.error», in the Error queue field
  • Enter the Queue Manager name in the «Error queue manager» field

  • Expand General section
  • Enter the broker schema that is to be used for the message flows, say «notification»
  • Enter the prefix that is to be used for the message flow names in the Flow prefix text field, say «amcExpiry»
  • Provide a description to document the purpose of the message flow in the Long description field

Use a Flow prefix whenever you generate a Pattern instance from a pattern. Later on, when you create another pattern instance from the same pattern, it will be easy for you to distinguish the message flows.

Use a broker schema that does not contain any period characters. If you use periods, the Pattern instance generation reports errors.

  • Click the Generate button found at the bottom of «Configure Pattern Parameter» screen

Note the following.

  1. A new Pattern instance with the name «AmcExpiryRptSplitter» appears under «Pattern Instances» in Broker Development view.
  2. A Summary file is generated within the Pattern instance project.
  3. The message flows are generated within the folder «notification» as we used the broker schema «notification»
  4. The message flow names are prefixed with the flow prefix that we used, i.e. «amcExpiry»

The pattern instance is generated and ready. Now we can create and configure the required resources.

Create the required resources

  • Open the summary file generated in the Pattern instance project using a web browser i.e. the file named AmcExpiryRptSplitter_summary.html

The first part lists the message flows that are part of the pattern instance.

  • Scroll down to the Tasks to complete section

Note down the instructions that are to be completed. For this Pattern instance, we need to do the following

  1. Create the required MQ Queues
    1. custinfo.amcexpiry.in
    2. notification.amcexpiry.out
    3. BAD
    4. notification.amcexpiry.error
  2. Add the pattern instance to a broker archive file and then select the option «Compile and in-line resources» before building the BAR file.
  • Using MQ Explorer, create the following MQ Queues

custinfo.amcexpiry.in notification.amcexpiry.out BAD notification.amcexpiry.error

Deploy and test the generated application

The BAR can be generated next and deployed in message broker.

  • Click File menu | Select New menu-item | Select BAR file menu-item

  • Select BARfiles from Container drop-down
  • Give a name to the BAR file, say «AmcExpiryRptSplitter»
  • Click the Finish button

A BAR file is generated with the name AmcExpiryRptSplitter.bar. The BAR file editor opens automatically as shown below.

  • Select the message flow application, in our case «AmcExpiryRptSplitter»

  • Check «Compile and in-line resources» option under Build Options in BAR content editor

  • Click Build and Save button

Toolkit confirms the successful completion of the build.

  • Click OK button

  • Now deploy the .bar file by right clicking on it and selecting the Deploy menu-item from the pop-up menu
  • Right click amcExpiryMessageSplitter.msgflow and select «Test Message Flow» menu-item in the pop-up menu
  • Click the Configuration tab of test client
  • Select the option «I will deploy the specified Broker Archive manually«
  • Click the Browse button and select the BAR file

  • Go back to «Events» tab in test client
  • Use the «Enqueue» option and place the XML file amcExpiryReport.xml in the MQ Queue «custinfo.amcexpiry.in»
  • Click «Send Message» button

  • Use the Dequeue button in the test client and get the message from the MQ Queue «notification.amcexpiry.out»

  • Get the next message from the same queue

Since we had two customer elements in the input XML, we have two messages in the output MQ queue.

We have successfully split the AMC expiry report from Customer Information component and placed the messages in the output MQ Queue using the pattern instance generated from the Message Splitter pattern.

Appendix A: List of patterns provided by WMB 8.0

Area Functionality Pattern
1 Application Integration SAP MQ one-way (IDoc)
2 File Processing Record Distribution MQ one-way
3 Message-based Integration Message Correlator MQ request-response with persistence
4 MQ request-response without persistence
5 Message Splitter MQ one-way (XML)
6 Mobile Worklight Microsoft .NET request-response
7 Mobile service
8 Push notification from MQ
9 Resource handler
10 Service Enablement Service Access MQ one-way
11 Service Façade MQ one-way with acknowledgment
12 MQ request-response
13 Microsoft .NET request-response
14 Service Virtualization Service Proxy Static endpoint
15 Static endpoint (web based)

I hope you enjoyed that little foray into IBM WebSphere Message Broker 8 patterns.

Regards,

Steve Robinson – WebSphere Consultant & Middleware Mentor

How to Install Git on Ubuntu 12.04

About Git


Git is a distributed version control system released to the public in 2005. The program allows for non-linear development of projects, and can handle large amounts of data effectively by storing it on the local server.

This tutorial will cover two ways to install Git.

How to Install Git with Apt-Get


Installing Git with apt-get is a quick and easy process. The program installs on the virtual private server with one command:

sudo apt-get install git-core

After it finishes downloading, you will have Git installed and ready to use.

How to Install Git from Source


If you are eager to download the most recent version of Git, it is generally a good idea to install it from the source.

Quickly run apt-get update to make sure that you download the most recent packages to your VPS.

sudo apt-get update

Prior to installing Git itself, download all of the required dependancies:

sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential

Once they are installed, you can download the latest version of Git from the google code page.

wget https://git-core.googlecode.com/files/git-1.8.1.2.tar.gz

After it downloads, untar the file and switch into that directory:

tar -zxf git-1.8.1.2.tar.gz
cd git-1.8.1.2

If you want to do a global install, install it once as yourself and once as root, using the sudo prefix:

make prefix=/usr/local all
sudo make prefix=/usr/local install

If you need to update Git in the future, you can use Git itself to do it.

git clone git://git.kernel.org/pub/scm/git/git.git

How to Setup Git


After Git is installed, whether from apt-get or from the source, you need to copy your username and email in the gitconfig file. You can access this file at ~/.gitconfig.

Opening it following a fresh Git install would reveal a completely blank page:

sudo nano ~/.gitconfig

You can use the follow commands to add in the required information.

git config --global user.name "NewUser"
git config --global user.email newuser@example.com

You can see all of your settings with this command:

git config --list

If you avoid putting in your username and email, git will later attempt to fill it in for you, and you may end up with a message like this:

[master 0d9d21d] initial project version
 Committer: root 
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

See More


This tutorial covered how to install Git on your virtual private server. Stay tuned for a second tutorial on Git Basics.

OpenERP Module Development

We will start by creating a simple OpenERP module with only one form and one table in PostgreSQL database with no relations at all. Later on we will extend this simple module in more complex module with multiple forms, multiple tables and relations step by step. I assume that u have installed OpenERP All-In-One that includes OpenERP Server, OpenERP Web Client, OpenERP GTK Client and PostgreSQL and I assume that its configured and working fine.

I am using Ubuntu 9.10

    • Open terminal and write sudo nautilus. Than enter your password. A file browser window will open. Browse to the addons folder in the openerp-server. The path would be something like this e.g, /usr/local/lib/python2.6/dist-packages/openerp-server/addons/
    • create a new folder in it and name it “sim”, short for Student Information Management. Open the folder.
    • Create the following files in the sim folder.
      1. __init__.py (its “double underscore init double underscore.py”). Python file.
      2. __terp__py (its “double underscore terp double underscore.py”). Python file.
      3. sim.py Python file
      4. sim_view.xml XML file.
    • Open __init__.py file and write the following code.
1
import sim

sim is the name of our module that we are developing and its the name our major python file that will include all our python code. Save the file and exit

  • Open __terp__.py file and write the following code.
1
2
3
4
5
6
7
8
9
10
11
12
13
{
'name': 'Student Information Management',
'version': '0.1',
'category': 'Tools',
'description': """This module is for the Student Information Management.""",
'author': 'Mir Nauman Tahir',
'depends': ['base'],
'init_xml': [],
'update_xml': ['sim_view.xml'],
'demo_xml': [],
'installable': True,
}

You can write your own strings in “name, description,author and website”Save the file and exit

  • Now open sim.py file and write the following code.
1
2
3
4
5
6
7
8
9
10
11
class student(osv.osv):
    _name = "sim.student"
    _description = "This table is for keeping personal data of student"
    _columns = {
        'name': fields.char('Registration Number',size=256,required=True),
        'student_name': fields.char('Student Name',size=256,required=True),
        'father_name': fields.char('Father Name',size=256),
        'gender':fields.selection([('male','Male'),('female','Female')],'Gender'),
        'contact_no':fields.char('Contact Number',size=256)
    }
student()

This code will create a table in the database “student”. The value for _description can be any string of your choice. _column is a dictionary and contains all the column names of the table with their data types. In side the parenthesis is the caption for that field that will appear on the form, its size and “required=True” shows that its a must to enter this field. The “field.selection” creates a drop down list control that has two items, Male and Female. The “student()” shows the end of the class. Some precautions. Python is a language that works with indentation. One space extra or less can generate billions of errors and you wont get a proper clue, if you are not using the proper editor.

  • Open the sim_view.xml file and write the following code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="student_form">
<field name="name">Studentfield>
<field name="model">sim.studentfield>
<field name="type">formfield>
<field name="arch" type="xml">
<form string="Student">
<field name="name"/>
<field name="student_name"/>
<field name="father_name"/>
<field name="gender"/>
<field name="contact_no"/>
form>
field>
record>
<record model="ir.ui.view" id="student_tree">
<field name="name">Studentfield>
<field name="model">sim.studentfield>
<field name="type">treefield>
<field name="arch" type="xml">
<tree string="Student">
<field name="name"/>
<field name="student_name"/>
<field name="father_name"/>
<field name="gender"/>
<field name="contact_no"/>
tree>
field>
record>
<record model="ir.actions.act_window" id="action_student">
<field name="name">Studentfield>
<field name="res_model">sim.studentfield>
<field name="view_type">formfield>
<field name="view_mode">tree,formfield>
record>
<menuitem name="SIM/Student/StudentInfo" id="menu_sim_student" action="action_student"/>
data>
openerp>

From my perspective every view file for an OpenERP module will consist of atleast 3 or 4 parts

  1. The form part.
  2. The tree part.
  3. The action part.
  4. The menu part.

And thats how I have divided the above documents in 4 parts. Its not necessary that an OpenERP module must have all the above 4 parts. It can have form,action and menu parts or tree,action and menu or all the four parts. The 1st part will create a form view. It should be kept in mind that the sim.student, the sim.student should be exactly the same as the value for the _name=”sim.student”. This refers to the sim_student table for which we are creating this form. The form shows which view type it is, a tree or a form. The next important block is the ,….. the values for the name here will be the exact column names from our sim.py file. The rest of the things don’t need much explanation for now. The 2nd part contain exactly the same things as the form view with very few differences like the type is tree here instead of form. And the column fields are encapsulated in the . This will create a grid type view displaying all the rows and column that are entered. This grid type view is called tree view. The 3rd part is the action. In res_model give the exact model name or the table name from our sim.py file, I.e “sim.student”. Specify a view_type that is form and view mode that is tree, form. The action defines when a menu is clicked for this action which form will it open. In the menu, id of this action will be used. The 4th part is related to creating the menu. A menu has the following important parts that are name,id,action and in some cases parent. There are two ways for creating a menu. I have used a way that I found more simple. “SIM/Student/StudentInfo”, SIM is the primary menu and appears in the left pane. When SIM is clicked Student menu will appear in the right pane. When student is clicked StudentInfo will appear and when StudentInfo is clicked it will open the form that is defined in the action for this menu. Save the file, exit. Now run OpenERP client. Install the current developed module and check it in working condition. More complexities to this tutorial will be added soon.

How to make a custom WIDGET in OpenERP…

 

Hello PeoplezZ,
    Today, here i will show you the method of creating your own custom WIDGET in OpenERP.

First of all, u all must know the structure of the OpenERP module, that is this much things must be there in every module.

—————————————————————————————————————

<addon name>
  +-- __openerp__.py
  +-- controllers/
  +-- static/
       +-- lib/
       +-- src/
            +-- css/
            +-- img/
            +-- js/
            +-- xml/
       +-- test/
  +-- test/

—————————————————————————————————————
First of all,
What is a widget.?
Ans. The example of widget of OpenERP are

  • Example: widget=”one2many_list”
    • one2one_list
    • one2many_list
    • many2one_list
    • many2many
    • url
    • email
    • image
    • float_time
    • reference
    • button
    • textbox

 The above examples are all WIDGETS in OpenERP and other than this u can create your know custom widget also. —————————————————————————————————————
So, here today i will show u the method that how u can create your own custom widget.

For creating your know custom widget in OpenERP you need this much files and folders in your OpenERP module that are

+-- static/
       +-- src/
            +-- css/
            +-- img/
          +-- js/
            +-- xml/

 In static folder you have to create the following folders that are css, img, js and xml.

for the custom widget u have to create 2 thing i.e. js file  and xml file.

In the js folder you have to create your js file i.e. JavaScript file in which u have write the script for creating the custom widget.
Here, I am showing u the example of my custom widget which i had create
for sharing the resource on facebook. I had created a like button of facebook in my widget.
—————————————————————————————————————

resource.js
—————————————————————————————————————
 openerp.resource = function (openerp)
{  
    openerp.web.form.widgets.add(‘test’, ‘openerp.resource.Mywidget’);
    openerp.resource.Mywidget = openerp.web.form.FieldChar.extend(
        {
        template : «test»,
        init: function (view, code) {
            this._super(view, code);
            console.log(‘loading…’);
        }
    });
}
—————————————————————————————————————
Here, i had shown u my resource.js for creating a custom widget.
In the first line i.e. 

  •  openerp.resource = function (openerp)

In this line openerp is fixed u have to write it bcz u r creating in OpenERP
than resource is your addon_name than function(openerp) in this openerp is the instance it may be anything.

  •  openerp.web.form.widgets.add(‘test’, ‘openerp.resource.Mywidget’);

 In this line openerp is the instance name which u have passed the function argument, than web.form.widgets.add is the place where u r adding ur custom widget it will be the same and than (‘test’, ‘openerp.resource.Mywidget’);
in this ‘test’ is your custom widget name it may be anything of ur choice, than ‘openerp.resource.Mywidget’ in this openerp is fixed than resource is your addon_name and than Mywidget is any name that u can give of ur choice.

  •      openerp.resource.Mywidget = openerp.web.form.FieldChar.extend(

In this line,» openerp.resource.Mywidget » this is the same thing which u have written in above line of adding method, than after «openerp.web.form.FieldChar.extend( » in this line openerp.web.form.FieldChar.extend( here I m extending the FIELDCHAR widget into my widget i.e. test.

  •        {
            template : «test»,
            init: function (view, code) {
                this._super(view, code);
                console.log(‘loading…’);
            }

In this line, first i am giving the template name which u have to pass in the xml file. i.e. template : «test»
and than after that init: function and everything are the thing which u have to pass as it is bcz they are the function argument of the fieldchar so u have to pass as it is.
and the last line i.e. console.log(‘loading…’);
console.log is same as the printf statement in C.
—————————————————————————————————————
—————————————————————————————————————

resource.xml
—————————————————————————————————————
<?xml version=»1.0″ encoding=»UTF-8″?>
<templates id=»template» xml:space=»preserve»>
<t t-name=»test»>
    <html>
        <body>
             <div id=»fb-root»></div>
            <div id=»fb-root»></div>
            <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = «//connect.facebook.net/en_US/all.js#xfbml=1»;
            fjs.parentNode.insertBefore(js, fjs);
            }(document, ‘script’, ‘facebook-jssdk’));</script>
            <div class=»fb-like» data-send=»true» data-layout=»box_count» data-width=»600″ data-show-faces=»false» data-font=»arial»></div>

        </body>
    </html>   
</t>
</templates>
—————————————————————————————————————
 After creating the js file u have to create the xml file for that i had shown u the example of it.

In this the main thing is  <t t-name=»test»> in that t-name=»test» in that test is your template name which u have given in the resource.js file, so u have to give it same.

And the thing that i had written in the <body> selection is the facebook api which u can find from the google or anything.

 

eg.: i had taken it from

 

 

 

 

So u can take it from here or as u like.

—————————————————————————————————————
And after completing this this.
I main thing that is dont forget to add that file into ur __openerp__.py file.
—————————————————————————————————————
     ‘js’: [‘static/src/js/resource.js’],
    ‘qweb’: [‘static/src/xml/resource.xml’],

—————————————————————————————————————

 

 js file u can add simply by ‘js’: than path

 

but for adding the xml file u have to write ‘qweb’: than path

 

 

————————————————————————————————————— 
Now, after creating your custom widget u can use it into any field as ur wish into ur view.xml file. 

<field name= «share» string= «Share it… :» widget= «test» /> 

Here, I had placed my widget into the share field so at that place the facebook widget will be available.
It will appear like

OpenERP Create Web Module

                                                                    By : Pinakin Nayi

                                                                           Trainee OpenERP (Jan 2012) ,
                                                                           Gandhinagar .
                                                                           nayi_pinakin@yahoo.in


Hello ,
        You all are going to search «OpenERP Web Module». I hope this will helpful to you.
OpenERP Web Module.

–> To build web module you have to create a module at server addons.

–> You need to first create
                  __init__.py and
                  __openerp__.py file similar as server addons.
Where
 __openerp__.py have more parameters likes
{

“name”: “lib_resource”,
“category” : “Hidden”,
“description”:’Openerp web Library’,
“version”: “2.0″,

“depends”: [‘web’,’project’],
qweb’ : [‘static/src/xml/lib.xml’],
“css”: [],
“js”: [‘static/src/js/lib.js’],
“auto_install”: True
}

–> As you see in above code. how to add your css and js and qweb templates.

        Inside your module need to manage folder structure.
       
        lib_resource/static/src/xml   ->  Files related to qweb templates
       
        lib_resourcer/static/src/js     ->  Files related to javascript which you create or code.
       
        lib_resource/static/lib          ->  Put your javascript related libs and js plugins….

__openerp__.py
__init__.py

*–> Create
        lib.js file at lib_resource/static/src/js.

        Note : Now most important rule to remember. inside lib.js you need to create openerp new namespace lib_resource.
       
        openerp.lib_resource = function(openerp)
        {
            var myTemplate  =  ’link’,   // template for qweb rendering … we can manage it as per our requirement.
            Here you can create new function or global variables.
            Also if you want to modify or inherit any existing class or libs the  here you can manage that.
            Here you can inherit any existing class and modify its operation and also able to create new classes…
        }

–> lib.xml  [ at ] lib_resource/static/src/xml

 This file holds information regarding qweb template’s.
What is qweb???
when we try to load the page then templates render on qweb.js and qweb2.js
these 2 files are containing all the information well i also do not know deeply about this because we have never try to know that thing.
meanly it is used for loading the templates for different views
 example :
   
    <?xml version=”1.0″ encoding=”UTF-8″?>
   
    <templates id=”link1” xml:space=”preserve”>   
        <t t-name=”link”>
            <div>………………… manage your template……………    </div>
        </t>   
    </templates>

–> OpenERP Web Module { Level 2 } :
   
    If you want to create new  widget for form.
   
    openerp.lib = function(openerp)
    {
        openerp.web.form.<class name> = openerp.web.form.<class name>.extend({
            ….. manage your code …..
        });
    }

For getting more grips on it review all most web addons in side server addons folders.

Note : ( Remember )
    OpenERP have main important files are located at :
    –>addons/web/static/src/js :-
        Here all js are main core js and on this other openerp javascript depended.
       
        boot.js, core.js, crome.js and data.js files are the heart of openerp framework.
        Where view_form.js, view_page.js and view_list.js are also most important to render list view and form views.
        Also all other files in this same directory are most important files.
       
        OpenERP have user jqeury differed all most in code. So need to grip on it too.
       
        addons/web/static/src/xml :- base.xml

——>>>>
This file hold all most all presentation view related templates.

Task: Backup Thunderbird mail and profile

 

You need to backup thunderbird mail and profile to tape drive, use:
$ tar zcvf /dev/st0 /home/you/.mozilla-thunderbird/
To backup files to USP pen driver mounted at /media/disk, enter
$ cp -avr /home/you/.thunderbird/ /media/disk
You need to backup thunderbird mail and profile to a /backup directory:
# tar zcvf /backup/email-vivek-22jan2007.tar.gz /home/vivek/.thunderbird/

You can copy /backup/email-vivek-22jan2007.tar.gz file to a CD/DVD or USB pen.

Task: Restore Thunderbird mail and profile

Make sure Thunderbird is not running. Simply copy backup files from tape, USB pen or CD to your /home/you/.mozilla-thunderbird/ directory:
$ tar –zxvf /backup/email-vivek-22jan2007.tar.gz -C /home/vivek

Or just copy all files from USB pen/CD to ~/.thunderbird/ directory.

 

Working with WebSphere Message Broker Toolkit

Note: i’m writing this, assuming that you’d already setup the message broker environment and installed toolkit. If not, please refer to the old posts on message broker on this blog, to know how to do it. 

Now, we have Websphere message broker installed and the environment is setup. we created a broker, configuration manager and user name server. Also installed Message broker toolkit. Now we want to know, what as an administrator can we do from Message broker toolkit.

yes, as you might have read or know, Message broker toolkit [will referred as toolkit in this article] has 2 prespectives.
1. Development prespective
For developing, editing and changing message flows and message sets.
2. Administration prespective.
for administration of brokers, domains etc..

for this tutorial, we work in the administration prespective.
From the toolkit menu bar
Click Window –> Open Perspective –> Broker Administration
create a broker domain
1. for this first, Create a connection to the configuration manager created earlier.
In the Broker Administration Navigator view, right-click in the Domain area and select New –> Domain
2. now the wizard will as you for some inputs.Give them, reffering to the configiuration manager.
Queue Manager name, Host, Port etc
3. Now give server project name and Connection name.
your connection name appears in toolkit as ‘choosen_name.configmgr’
4. You may be asked Do you want to create a new Server project with the name xyz, click Yes
5. click Finish.
Connecting to broker domain
1. In the tooklit, under domains…select the domain which you creatd above.
2. Verify, wether it is in connected state or not connected
3. If not connected
Right click on the broker domain connection entry and select connect from the drop down list.
4. Once the connection was made, you can see the status changing to ‘connected’
Now, you’ve defined a new broker domain and connected successfully to it. The next step is to get the brokers under it.
Registering Brokers
In this step, we register the broker with the configuration manager
1. Right click on the domain connection entry and select broker–>new
note: even though it is shown as ‘new’, we are not creating new broker but just connecting existing broker to this domain.
2. Now, enter the dialog boxes that appers
Broker name, Broker Queue Manager name,
3. Select Finish and in the next window select either Delta or Complete deploy.
4. Verify the deploy log. [double click the event log under domains view]
5. Once it is Finished, you can see, your broker under the broker topology. also if you have any execution groups which were already defined in broker, they will be shown under the broker.
Now we have broker domains and a broker inside it. Let us try deploying an broker archive.
Deploying a Message flow with a BAR file
1. Expand the ‘broker archive’ in the broker administration prespective of the toolkit
2. Import the broker archive [.bar] file using menu ->file Import ->filesystem
3. Once the file was located, browse and select the server project [which you specified while creating broker domain]
4. Click OK and Finish
5. Now, your BAR file appear under server project.
6. Now right click on the BAR file and select deploy file.
7. Select the target [execution group] and finish
Once successfully deployed, you can see under the ‘execution group’ which was under broker. You can also verify the event log, through out this process.
Now, you have a Broker domain -> A broker ->execution group ->a Message flow. Voila, we are done with this tutoria

Backup and Restore WebSphere Message Broker domain

Back up the domain 

1. Before taking the back up of the domain, you need to stop the config manager and broker. 
    mqsistop Config_Mnager 
    mqsistop Broker 
    mqsistop UserName_Server 

2. Back up the configuration manager 
    mqsibackupconfigmgr Config_Manager -d Backup_direcotry     BIP1075I: Creating backup archive for Configuration Manager ‘Config_Manager’ in directory ‘xyz’ … 
    BIP1017I: A backup archive called ‘Config_Manager_100507_002836.zip’ was created successfully. 
    BIP8071I: Successful command completion.
3. service.properties file to the backup directory. This is necessary if you want to backup and restore the actual configuration manager repository. It must be kept with the zip file you have created.

4. Back up the broker database also with the help of DBA 
Restoring the domain:


Lets just imagine that you’ve deleted the config manager. 
1. Now create the config manager with same name 
    mqsicreateconfigmgr Config_Manager -i username -a password -q QM_name -w PATH
2. Now, run the restore command 
    mqsirestoreconfigmgr Config_Manager -d backup_directory -a backup_file_name -w PATH 
3. After the restore is completed, Start the config manager and broker. 
    mqsistart Config_Manager 
    mqsistart Broker 

4. Verify, whether the domain is properly restored by going to the Message Brokers Toolkit, connecting to the domain and attempting to stop and then start one of the message flows. Be sure to check you Event Log to ensure everything worked properly

WebSphere Message Broker (WMB) Nodes

Message broker nodes are used in Message flows.  A message flow node is a processing step in a message flow. 

A message flow node receives a message, performs a set of actions against the message, and optionally passes the message on to the next node in the message flow. A message flow node can be a built-in node, a user-defined node, or a subflow node. 
    A built-in node is a message flow node that is supplied by WebSphere Message Broker. The built-in nodes provide input and output, manipulation and transformation, decision making, collating requests, and error handling and reporting functions. 
    A user-defined node is an extension to the broker that provides a new message flow node in addition to those supplied with the product. It must be written to the user-defined node API provided by WebSphere Message Broker for both C and Java languages. 
    A subflow is a directed graph that is composed of message flow nodes and connectors and is designed to be embedded in a message flow or in another subflow. A subflow must include at least one Input node or one Output node. A subflow can be executed by a broker only as part of the message flow in which it is embedded, and therefore cannot be independently deployed. 
A message flow node has a fixed number of input and output points known as terminals. You can make connections between the terminals to define the routes that a message can take through a message flow. 
Input and output nodes define points in the message flow to which client applications send messages, and from which client applications receive messages.Client applications interact with these nodes by putting messages to, or getting messages from, the I/O resource that is specified by the node as the source or target of the messages. Although a message flow must include at least one input node, it does not need to include an output node.
Overview of all the nodes available in WMB v6.0, 6.1 and 7.0

Input Nodes:
MQInput 
    Use an MQInput node if the messages arrive at the broker on a WebSphere MQ queue, and the node is to be at the start of a message flow. 
MQGet 
    Use an MQGet node if the messages arrive at the broker on a WebSphere MQ queue and the node is not to be at the start of a message flow. 
SCADAInput 
    Use a SCADAInput node if the messages are sent by a telemetry device. 
HTTPInput 
    Use an HTTPInput node if the messages are sent by a Web services client. 
Real-timeInput or Real-timeOptimizedFlow 
    Use one of these nodes if the messages are sent by a JMS or multicast application.    The Real-timeInput node is an input node and the Real-timeOptimizedFlow node is a complete message flow that provides a high performance publish/subscribe message flow. 
JMSInput 
    Use a JMSInput node if the messages are sent by a JMS application. 
User-defined input node 
    Use a user-defined input node if the message source is a client or application that uses a different protocol or transport. 
Input node 
    If you are creating a message flow that you want to embed in another message flow (a subflow) that you will not deploy as a stand-alone message flow, you must include at least one Input node to receive messages into the subflow.
Output Nodes:
Publication 
    Use a Publication node to distribute the messages using the publish/subscribe network for applications that subscribe to the broker across all supported protocols. 
MQOutput 
    Use an MQOutput node if the target application expects to receive messages on a WebSphere MQ queue, or on the WebSphere MQ reply-to queue that is specified in the input message MQMD 
MQReply 
    Use an MQReply node if the target application expects to receive messages on the WebSphere MQ reply-to queue that is specified in the input message MQMD. 
SCADAOutput 
    Use a SCADAOutput node if a telemetry device is the target of the output messages, and the Publication node is not suitable. 
HTTPReply 
    Use an HTTPReply node if the messages are in response to a Web services client request. 
HTTPRequest 
    Use an HTTPRequest node if your message flow interacts with a Web service. 
Real-timeOptimizedFlow 
    Use a Real-timeOptimizedFlow node if the target application is a JMS or multicast application. 
JMSOutput 
    Use a JMSOutput node if the messages are for a JMS destination. 
User-defined output node 
    Use a user-defined output node if the target is a client or application that uses a different protocol or transport. 
Output node 
    If you are creating a message flow that you want to embed in another message flow (a subflow) that you will not deploy as a stand-alone message flow, you must include at least one Output node to propagate messages to subsequent nodes that you connect to the subflow.
Nodes for manipulating, enhancing, and transforming messages
Compute 
    Use the Compute node to: 
        * Manipulate message content 
        * Transform the message in some way 
        * Interact with a database to modify the content of the message or the database and pass on one or more new messages 
JavaCompute 
    Use the JavaCompute node to: 
        * Examine an incoming message and, depending on its content, propagate it unchanged to one of the node’s two output terminals. The node behaves in a similar way to a Filter node, but uses Java™ instead of ESQL to decide which output terminal to use. 
        * Change part of an incoming message and propagate the changed message to one of the output terminals. 
        * Create and build a new output message that is totally independent of the input message. 
Mapping 
    Use the Mapping node to create a new message from the input message by mapping the content of elements of the output message from elements of the input message, or from database content. You can also extract parts of the message, and optionally change their content, to create a new output message that is a partial copy of the message that is received by the node. 
Database 
    Use the Database node to interact with a database that is identified by the node properties. The Database node handles both predefined and self-defining messages. 
DataDelete, DataInsert, DataUpdate 
    The DataDelete, DataInsert, and DataUpdate nodes are specialized forms of the Database node that provide a single mode of interaction (deletion of one or more rows, insertion of one or more rows, or update of one or more existing rows). 
Warehouse 
    The Warehouse node provides a store interface that you can use to store all or part of the message in a database 
XMLTransformation 
    Use the XMLTransformation node to transform an input XML message into another format using XSLT style sheets.
    It, can perform the following actions: 
    * Sort the data 
    * Select data elements to include or exclude based on some criteria 
    * Transform the data into another format 
JMSMQTransform 
    Use the JMSMQTransform node to transform a message with a JMS message tree into a message that has a tree structure that is compatible with the format of messages that are produced by the WebSphere MQ JMS provider. 
MQJMSTransform 
    Use the MQJMSTransform node to receive messages that have a WebSphere MQ JMS provider message tree format, and transform them into a format that is compatible with messages that are to be sent to JMS destinations. 
MQOptimizedFlow 
    Use the MQOptimizedFlow node to replace a publish/subscribe message flow that consists of an MQInput node connected to a Publication node, and that uses the JMS over WebSphere MQ transport. 
User-defined 
    Use a user-defined node to handle specific requirements that are not met by the built-in nodes.
Decision making nodes
Validate 
    Use the Validate node to check that the message that arrives on its input terminal is as expected.     
Filter 
    Use the Filter node with an ESQL statement to determine the next node to which the message is sent by this node.    
FlowOrder 
    You can connect the terminals of this node to force the message to be processed by one sequence of nodes, followed by a second sequence of nodes. 
Passthrough 
    Use the Passthrough node to enable version control of a subflow at run time. Use this node to add a label to your subflow.    
RouteToLabel and Label 
    Use the RouteToLabel node following a Compute node for complex routing. Define a list of destinations in a Compute node that are acted on by the RouteToLabel node, which interrogates the destinations and passes the message on to the corresponding Label node. 
ResetContentDescriptor 
    Use the ResetContentDescriptor node to set new message properties that are used when the message bit stream is next parsed by a subsequent node in the message flow.
Nodes for controlling time-sensitive operations
TimeoutControl 
    Use a TimeoutControl node and a TimeoutNotification node together in a message flow to control events that occur at a specific time or at defined time intervals. The TimeoutControl node receives an input message that contains a timeout request. All or part of this input message is validated and stored to be propagated by an associated TimeoutNotification node in the message flow. The input message is also propagated unchanged to the next node in the message flow. 
TimeoutNotification 
    Use a stand-alone TimeoutNotification node to generate messages that are propagated at configured times or time intervals to the next node in the message flow for further processing.
Nodes for collating requests
Use the AggregateControl, AggregateReply, and AggregateRequest  nodes to collate related requests and responses. Use these nodes to generate several requests in response to one input message, to control and coordinate the responses that are received in response to those requests, and to combine the information that is provided by the responses to continue processing.
Error handling and reporting nodes
Trace 
    Include a Trace node to generate one or more trace entries to record what is happening in the message flow at this point. 
TryCatch 
    Include a TryCatch node to control the error processing when exceptions are thrown. 
Throw 
    Include a Throw node to force an exception to be thrown, and specify the identity of the exception, to make it easier to diagnose the problem.
New nodes in v6.1
File and FTP nodes
FileInput node reads files from the local file system or FTP server 
FileOutput node writes files to the local file system or FTP server
Route, database route nodes:
The new Route node provides a graphical technique to enable incoming requests to be examined, and flow sent down the appropriate part of the message flow, depending on the specified criteria. 
The DatabaseRoute node provides a similar function to the Route node, but the routing decision is based on the contents of a relational database. 
DatabaseRetrieve node enables data to be retrieved from one of more relational databases, and use a similar dialogue to the DatabaseRoute node.
New nodes in V7
V7 introduced new nodes for SCA (service component architecture). These are nodes are basically for use with websphere process server which uses SCA. 
SCA Input Node: A WebSphere Process Server SCA Import component can use Message Broker as an SCA endpoint. The message received by the broker can be a SOAP over HTTP message or an MQ message on a queue, depending on the binding used by the node. 
SCA Reply Node: This allows a response message to be sent from the broker back to the originating Process Server SCA client, in response to a prior message received by an SCA Input Node. 
SCA Request Node: This allows synchronous requests to be made from the broker, allowing the broker to participate in synchronous message exchange patterns with a Process Server SCA export component. The message sent by the broker can be a SOAP message over HTTP, or an MQ message, depending on the binding used by the node. The node will perform a blocked wait for a specified time period until a response is received

WebSphere Message Broker (WMB) Quick reference guide

A quick reference for all WMB commands to perform day-to-day activities like create, modify, delete different components of message broker
[brokers, configuration manager, usernameserver, execution groups, security, deployment and db]

Settings up Command environment:

Run mqsiprofile script

Running Commands:

Commands must be lower case
Component names case sensitive

Start/Stop/Delete Broker:

Startmqsistart BrokerName
Stopmqsistop BrokerName

–q after name stops associated queue manager
–i after name stops immediately
Deletemqsideletebroker BrokerName [options]
Note: Broker must be stopped before it can be deleted

Start/Stop/Delete Configuration Manager:

Startmqsistart ConfigMgrName
Stop: mqsistop ConfigMgrName
–q after name stops associated queue manager
Deletemqsideleteconfigmgr [ConfigMgrName] [options]
–n flag to delete configuration repository
-w flag deletes all files in the configuration manager’s work path

Start/Stop/Delete UserNameServer:

Startmqsistart UserNameServer
Stop: mqsistop UserNameServer
–q after name stops associated queue manager
Deletemqsideleteusernameserver [options]
–q after name deletes associated queue manager
–w after name deletes all files in the work path associated with the User Name Server

Specifying Username and password:

You can specify the following flags along with the commands
–i userid
–a password
If you leave, -a flag black; it will prompt you for password.

Changing Broker

mqsichangebroker BrokerName [options]
-s — User Name Server queue manager name
-j — Enable publish/subscribe for the broker
-d — Disable publish/subscribe for the broker
-t — Run the broker as a trusted MQ application
-n — Stop running the broker as a trusted MQ application
-g — Configuration timeout — maximum time for response from an execution group
-k — Configuration delay timeout — maximum time for response from a broker

Changing Configuration Manager

mqsichangeconfigmgr [ConfigMgrName] [options]
-s — User Name Server queue manager name
-j — Maximum Java virtual machine heap size in megabytes. The default is 128.

Changing User name server

mqsichangeusernameserver [options]
-r — Refresh interval being the amount of time before the User Name Server interrogates
the security subsystem for changes to users or groups
-g — The name of the authentication data source
-j — Indicates use of a data source containing users and group information instead of
using the operating system
-o — Indicates use of the operating system users and group information
Note: before executing above change commands, the respective component must be stopped.

Execution Groups:

Createmqsicreatexecutiongroup [options]
Deletemqsideleteexecutiongroup [options]
-i host 
-p port number of the Configuration Manager-q Config Manager QM 
-q queue manager of Configuration Manager
-b Broker name 
–e Execution group name
-w timeout
– v tracefile name
Startmqsistartmsgflow [options]
Stopmqsistopmsgflow[options]
-i host 
-p port number of the Configuration Manager-q Config Manager QM 
-q queue manager of Configuration Manager
-b Broker name 
–e Execution group name
-m specific flow within the execution group
-w timeout
– v tracefile name
Report message flow statisticsmqsireportflowstats broker_name [options]
-e ExecutionGroupName
-f MessageFlow
-a Specify that the command modifies archive accounting and statistics collection.
-s Specify that the command modifies snapshot accounting and statistics collection.
-g Specifies that the command applies to all execution groups that belong to the broker.
-j Specifies that the command applies to all message flows that belong to the execution group.
Change message flow statisticsmqsichangeflowstats [options]
-e ExecutionGroupName
-f MessageFlow
-a Specify that the command modifies archive accounting and statistics collection.
-s Specify that the command modifies snapshot accounting and statistics collection.
-g Specifies that the command applies to all execution groups that belong to the broker.
-j Specifies that the command applies to all message flows that belong to the execution group.
-o OutputFormat; usertrace/xml

Deploy:

mqsideploy [options]
-p port number of the Configuration Manager
-q queue manager of Configuration Manager
-b Broker 
-e Execution Group 
-a BAR file 
-w Timeout

Listing resources

mqsilist [options]
– a List all the components
– brokerName The name of the broker for which you want to list resources
– e egName selects an execution group within a broker

Security Commands

Create ACLmqsicreateaclentry ConfigmgrName [options]
List ACL entriesmqsilistaclentries [options]
Delete ACL entriesmqsideleteaclentries [options]
-g GroupName The local group to which this entry refers
-u UserName The user name to which this entry refers
-m MachineName The name of the machine from which a specified user can connect.
-a The specified user name can be on any machine.
-x AccessLevel
F: Full control
D: Deploy
E: Edit
V: View
-b Broker
-e ExeGroup, You must specify the b flag if you specify this flag.
-s Subscription The object is a subscription object, and its name is specified as a parameter.
-r The object refers to the root topic.
-t The object refers to the main topology.
-p The object refers to the “allresources” resource type

Backup/Restore Commands

Backup: mqsibackupconfigmgr ConfigMgrName –d DirPath [options]
Restore: mqsirestoreconfigmgr ConfigMgrName –d DirPath –a ArchiveName [options]
-w WorkPath Specifies the path for the Configuration Manager repository

Problem Determination

Trace
Report Trace: mqsireporttrace [options]
Change Trace: mqsichangetrace [options]
-componentName The name of a broker, a Configuration Manager, or the fixed name User Name Server;
-e egName The label of the execution group for which a report is required. This option is valid only if you have specified a broker as the component.
-f messageFlow The label of the message flow for which a report is required. This option is valid only if you have specified a broker as the component, and an execution group.
-u Derive report information from the user trace.
-t Derive report information from the service trace.
-b Request a report for agent function.
-n Report the setting of the Trace node switch.
Read Trace: mqsireadlog BrkName [options] –o Output_file
-e Egroup
-o Outputfilename
-f Read the log file directly from the file system
-u Read the log contents from the user trace log.
-t Read the log contents from the service trace log.
Format Trace: mqsiformatlog –i input_file -o Output_file

Publish/subscribe commands

Add, remove, and list MQ publish/subscribe broker network
Add: mqsijoinmqpubsub Broker_name [options]
-p ParentQueueManagerName, The name of the queue manager that hosts the WebSphere MQ Publish/Subscribe broker to which this WebSphere Message Broker broker is to be joined
Remove: mqsiclearmqpubsub Broker_name [options]
-n NeighborQueueManagerName, The name of the queue manager that hosts the WebSphere MQ Publish/Subscribe broker for which the association as a neighbor is being removed.
List: mqsilistmqpubsub Broker_name

Database commands

CreateDB: 
(windows) mqsicreatedb DBName [options]
-i ServiceUserID, The user ID under which the DatabaseInstanceMgr service runs
-a ServicePassword, The password for the ServiceUserID
-p PortNumber, The TCP/IP port number that this component will use on the local machine
-e DbType
-u DbUserID, An additional user name that requires access to the database that is created by this command.
(unix/Linux) mqsi_setupdatabase [options]
-Database_Home_Directory, The name of the directory in which the database is (or will be) installed
Change user ID andpassword information
mqsisetdbparms BrokerName [options]
-n ResourceName or AdapterName
-u UserId or EISUserId
-p Password
-d This parameter deletes the user ID and password pair for this resource from the registry.
-a Specify this parameter to process the mqsisetdbparms command when the broker itself is running