Wednesday, 15 July 2015

Tables

Base Tables
===============
1)si_metrics_t

2)si_metric_columns

3)si_parameters

4)si_metric_filters

5)si_filter_parameters


Reports
===========
1)si_reports_t

2)si_report_columns

3)si_reports_filters

4)si_report_col_color_conditions

5)si_filter_parametrs

6)si_report_report_param_mapping

7)si_report_form_param_mapping

8)si_user_reports

9)si_report_row_formats


Lookup tables
================
1)si_lookups_tl

2)si_messages_tl

3)si_locales


Dashboards
================
1)si_dashboards_t

2)si_presentations_t

3)si_presentation_columns

4)si_presentation_filters

5)si_dashboard_statistics

6)si_presentation_reports

7)si_chart_dash_relationship

8)si_chart_properties

9)si_user_dashboards

Push Infolet
=================
1)si_metrics_t

2)si_metric_columns

3)si_metric_parameter_inputs

4)si_ems_input_filters

5)si_ems_input_filter_params

6)si_ems_default_filters

7)si_ems_default_filter_params

8)si_metric_ems_reports

9)si_report_ems_parameters

10)si_metric_groups

11)si_metric_group_details

Threshold
==============

1)si_thresholds


Action
==============
1)si_actions

2)si_parameters

Alert
===============
1)si_alerts

2)si_alert_actions

Process Flow
===============
1)si_process_flow

2)si_process_flow_layout

3)si_pf_object_details

Organization
================
1)si_org_hierarchy

Location
================
1)si_org_locations_t

2)si_org_entities

3)si_activities_t

4)si_user_infocenter

5)si_infoport_t

6)si_infoport_objects

Roles
====================

1)si_roles_t

2)si_role_activities

3)si_role_objects

List of values
====================

1)ms_qs_lov_names

2)ms_qs_list_of_values

parameter Type
====================

1)ms_qs_parameter_types

2)ms_qs_parameter_names

3)ms_qs_parameter_values

Data Table
====================

1)si_data_tables

2)si_data_columns


Data Object
====================

1)ms_apps_entity_attributes

2)ms_apps_entity_region

3)ms_apps_visual_entity

4)ms_apps_visual_entity_attr

Error Table
=====================

1)ms_apps_mdf_errors


Environment
=====================

1)si_ent

2)si_ent_applications


Data Form Tables
=======================

1)ms_apps_visual_entity --> Header Level details

2)ms_apps_visual_entity_attr --> Attribute Level details

3)ms_apps_visual_entity_comp --> Object Level details

4)ms_apps_visual_entity_report --> Report Level details

5)ms_apps_appbuilder_log --> Provide deployment log details and other log information for each step that uses the data designer

Ext JavaScripit

 1. MessageBox.1

/*global Ext:false */
Ext.onReady(function () {
    Ext.Msg.alert('Status', 'Changes saved successfully.');
});

=========================================================================================

2. Prompt Box

/*global Ext:false */
Ext.onReady(function () {
    Ext.Msg.prompt('Name', 'Please enter your name:', function (btn, text) {
        if (btn == 'ok') {
            // process text value and close...
        }
    });
});

=========================================================================================

3. Confirm Box

/*global Ext:false */
Ext.onReady(function () {
    Ext.Msg.show({
        title: 'Save Changes?',
        msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
        buttons: Ext.Msg.YESNOCANCEL,
        icon: Ext.Msg.QUESTION
    });
});

==============================================================================================

4. Button.1

Ext.onReady(function () {
    Ext.create('Ext.Button', {
        text: 'Click me',
        renderTo: Ext.getBody(),
        handler: function () {
            alert('You clicked the button!');
        }
    });
});

===============================================================================================

5. Button.2

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.Button', {
        text: 'Dynamic Handler Button',
        renderTo: Ext.getBody(),
        handler: function () {
            // this button will spit out a different number every time you click it.
            // so firstly we must check if that number is already set:
            if (this.clickCount) {
                // looks like the property is already set, so lets just add 1 to that number and alert the user
                this.clickCount++;
                alert('You have clicked the button "' + this.clickCount + '" times.\n\nTry clicking it again..');
            } else {
                // if the clickCount property is not set, we will set it and alert the user
                this.clickCount = 1;
                alert('You just clicked the button for the first time!\n\nTry pressing it again..');
            }
        }
    });
});

=====================================================================================================

6. forms.1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        renderTo: Ext.getBody(),
        title: 'User Form',
        height: 500,
        width: 1200,
        bodyPadding: 10,
        defaultType: 'textfield',

layout: {
            type: 'vbox'
        },

        items: [{
            fieldLabel: 'First Name',
            name: 'firstName',
allowBlank:false
        }, {
            fieldLabel: 'Last Name',
            name: 'lastName'
        },  {
            fieldLabel: 'Email',
            name: 'email',
vtype:'email'
        },{
            xtype: 'datefield',
            fieldLabel: 'Date of Birth',
            name: 'birthDate'
        }]
    });
});

====================================================================================================

7. forms.2

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        renderTo: Ext.getBody(),
        title: 'User Form',
        height: 100,
        width: 800,
        defaults: {
            xtype: 'textfield',
            labelAlign: 'top',
            padding: 10
        },
        layout: {
            type: 'hbox'
        },
        items: [{
            fieldLabel: 'First Name',
            name: 'firstName'
        }, {
            fieldLabel: 'Last Name',
            name: 'lastName'
        }, {
            xtype: 'datefield',
            fieldLabel: 'Date of Birth',
            name: 'birthDate'
        }]
    });
});

====================================================================================================

8. Grid.Panel

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.data.Store', {
        storeId: 'simpsonsStore',
        fields: ['name', 'email', 'phone'],
        data: {
            'items': [{
                'name': 'Lisa',
                "email": "lisa@simpsons.com",
                "phone": "555-111-1224"
            }, {
                'name': 'Bart',
                "email": "bart@simpsons.com",
                "phone": "555-222-1234"
            }, {
                'name': 'Homer',
                "email": "home@simpsons.com",
                "phone": "555-222-1244"
            }, {
                'name': 'Marge',
                "email": "marge@simpsons.com",
                "phone": "555-222-1254"
            }]
        },
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });

    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [{
            text: 'Name',
            dataIndex: 'name'
        }, {
            text: 'Email',
            dataIndex: 'email',
            flex: 1
        }, {
            text: 'Phone',
            dataIndex: 'phone'
        }],
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });
});

=============================================================================================

Panel

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.tab.Panel', {
        width: 400,
        height: 400,
        renderTo: document.body,
        items: [{
            title: 'Foo'
        }, {
            title: 'Bar',
            tabConfig: {
                title: 'Custom Title',
                tooltip: 'A button tooltip'
            }
        }]
    });
});


=================================================================================================

Checkbox

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        bodyPadding: 10,
        width: 300,
        title: 'Pizza Order',
        items: [{
            xtype: 'fieldcontainer',
            fieldLabel: 'Toppings',
            defaultType: 'checkboxfield',
            items: [{
                boxLabel: 'Anchovies',
                name: 'topping',
                inputValue: '1',
                id: 'checkbox1'
            }, {
                boxLabel: 'Artichoke Hearts',
                name: 'topping',
                inputValue: '2',
                checked: true,
                id: 'checkbox2'
            }, {
                boxLabel: 'Bacon',
                name: 'topping',
                inputValue: '3',
                id: 'checkbox3'
            }]
        }],
        bbar: [{
            text: 'Select Bacon',
            handler: function () {
                Ext.getCmp('checkbox3').setValue(true);
            }
        }, '-',
        {
            text: 'Select All',
            handler: function () {
                Ext.getCmp('checkbox1').setValue(true);
                Ext.getCmp('checkbox2').setValue(true);
                Ext.getCmp('checkbox3').setValue(true);
            }
        }, {
            text: 'Deselect All',
            handler: function () {
                Ext.getCmp('checkbox1').setValue(false);
                Ext.getCmp('checkbox2').setValue(false);
                Ext.getCmp('checkbox3').setValue(false);
            }
        }],
        renderTo: Ext.getBody()
    });
});

===============================================================================================

Combobox1

/*global Ext:false */
Ext.onReady(function () {
    // The data store containing the list of states
    var states = Ext.create('Ext.data.Store', {
        fields: ['abbr', 'name'],
        data: [{
            "abbr": "AL",
            "name": "Alabama"
        }, {
            "abbr": "AK",
            "name": "Alaska"
        }, {
            "abbr": "AZ",
            "name": "Arizona"
        }
        //...
        ]
    });

    // Create the combo box, attached to the states data store
    Ext.create('Ext.form.ComboBox', {
        fieldLabel: 'Choose State',
        store: states,
        queryMode: 'local',
        displayField: 'name',
        valueField: 'abbr',
        renderTo: Ext.getBody()
    });
});

=========================================================================================

Combobox2

/*global Ext:false */
Ext.onReady(function () {
    var states = Ext.create('Ext.data.Store', {
        fields: ['abbr', 'name'],
        data: [{
            "abbr": "AL",
            "name": "Alabama"
        }, {
            "abbr": "AK",
            "name": "Alaska"
        }, {
            "abbr": "AZ",
            "name": "Arizona"
        }]
    });

    Ext.create('Ext.form.ComboBox', {
        fieldLabel: 'Choose State',
        store: states,
        queryMode: 'local',
        valueField: 'abbr',
        renderTo: Ext.getBody(),
        // Template for the dropdown menu.
        // Note the use of "x-boundlist-item" class,
        // this is required to make the items selectable.
        tpl: Ext.create('Ext.XTemplate', '<tpl for=".">', '<div class="x-boundlist-item">{abbr} - {name}</div>', '</tpl>'),
        // template for the content inside text field
        displayTpl: Ext.create('Ext.XTemplate', '<tpl for=".">', '{abbr} - {name}', '</tpl>')
    });
});

==========================================================================================

Field.date1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        renderTo: Ext.getBody(),
        width: 300,
        bodyPadding: 10,
        title: 'Dates',
        items: [{
            xtype: 'datefield',
            anchor: '100%',
            fieldLabel: 'From',
            name: 'from_date',
            maxValue: new Date() // limited to the current date or prior
        }, {
            xtype: 'datefield',
            anchor: '100%',
            fieldLabel: 'To',
            name: 'to_date',
            value: new Date() // defaults to today
        }]
    });
});

=============================================================================================

Field.date2

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        renderTo: Ext.getBody(),
        width: 300,
        bodyPadding: 10,
        title: 'Dates',
        items: [{
            xtype: 'datefield',
            anchor: '100%',
            fieldLabel: 'Date',
            name: 'date',
            // The value matches the format; will be parsed and displayed using that format.
            format: 'm d Y',
            value: '2 4 1978'
        }, {
            xtype: 'datefield',
            anchor: '100%',
            fieldLabel: 'Date',
            name: 'date',
            // The value does not match the format, but does match an altFormat; will be parsed
            // using the altFormat and displayed using the format.
            format: 'm d Y',
            altFormats: 'm,d,Y|m.d.Y',
            value: '2.4.1978'
        }]
    });
});

=================================================================================================

Field.Display1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        renderTo: Ext.getBody(),
        width: 175,
        height: 120,
        bodyPadding: 10,
        title: 'Final Score',
        items: [{
            xtype: 'displayfield',
            fieldLabel: 'Home',
            name: 'home_score',
            value: '10'
        }, {
            xtype: 'displayfield',
            fieldLabel: 'Visitor',
            name: 'visitor_score',
            value: '11'
        }],
        buttons: [{
            text: 'Update'
        }]
    });
});


====================================================================================================

Field.File1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'Upload a Photo',
        width: 400,
        bodyPadding: 10,
        frame: true,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'filefield',
            name: 'photo',
            fieldLabel: 'Photo',
            labelWidth: 50,
            msgTarget: 'side',
            allowBlank: false,
            anchor: '100%',
            buttonText: 'Select Photo...'
        }],

        buttons: [{
            text: 'Upload',
            handler: function () {
                var form = this.up('form').getForm();
                if (form.isValid()) {
                    form.submit({
                        url: 'photo-upload.php',
                        waitMsg: 'Uploading your photo...',
                        success: function (fp, o) {
                            Ext.Msg.alert('Success', 'Your photo "' + o.result.file + '" has been uploaded.');
                        }
                    });
                }
            }
        }]
    });
});

===================================================================================================

Field.Htmleditior

/*global Ext:false */
Ext.onReady(function () {
    Ext.tip.QuickTipManager.init(); // enable tooltips
    Ext.create('Ext.form.HtmlEditor', {
        width: 580,
        height: 250,
        renderTo: Ext.getBody()
    });
});

===================================================================================================

Field.Number1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'On The Wall',
        width: 300,
        bodyPadding: 10,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'numberfield',
            anchor: '100%',
            name: 'bottles',
            fieldLabel: 'Bottles of Beer',
            value: 99,
            maxValue: 99,
            minValue: 0
        }],
        buttons: [{
            text: 'Take one down, pass it around',
            handler: function () {
                this.up('form').down('[name=bottles]').spinDown();
            }
        }]
    });
});

==================================================================================================

Field.Radio1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'Order Form',
        width: 300,
        bodyPadding: 10,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'fieldcontainer',
            fieldLabel: 'Size',
            defaultType: 'radiofield',
            defaults: {
                flex: 1
            },
            layout: 'hbox',
            items: [{
                boxLabel: 'M',
                name: 'size',
                inputValue: 'm',
                id: 'radio1'
            }, {
                boxLabel: 'L',
                name: 'size',
                inputValue: 'l',
                id: 'radio2'
            }, {
                boxLabel: 'XL',
                name: 'size',
                inputValue: 'xl',
                id: 'radio3'
            }]
        }, {
            xtype: 'fieldcontainer',
            fieldLabel: 'Color',
            defaultType: 'radiofield',
            defaults: {
                flex: 1
            },
            layout: 'hbox',
            items: [{
                boxLabel: 'Blue',
                name: 'color',
                inputValue: 'blue',
                id: 'radio4'
            }, {
                boxLabel: 'Grey',
                name: 'color',
                inputValue: 'grey',
                id: 'radio5'
            }, {
                boxLabel: 'Black',
                name: 'color',
                inputValue: 'black',
                id: 'radio6'
            }]
        }],
        bbar: [{
            text: 'Smaller Size',
            handler: function () {
                var radio1 = Ext.getCmp('radio1'),
                    radio2 = Ext.getCmp('radio2'),
                    radio3 = Ext.getCmp('radio3');

                //if L is selected, change to M
                if (radio2.getValue()) {
                    radio1.setValue(true);
                    return;
                }

                //if XL is selected, change to L
                if (radio3.getValue()) {
                    radio2.setValue(true);
                    return;
                }

                //if nothing is set, set size to S
                radio1.setValue(true);
            }
        }, {
            text: 'Larger Size',
            handler: function () {
                var radio1 = Ext.getCmp('radio1'),
                    radio2 = Ext.getCmp('radio2'),
                    radio3 = Ext.getCmp('radio3');

                //if M is selected, change to L
                if (radio1.getValue()) {
                    radio2.setValue(true);
                    return;
                }

                //if L is selected, change to XL
                if (radio2.getValue()) {
                    radio3.setValue(true);
                    return;
                }

                //if nothing is set, set size to XL
                radio3.setValue(true);
            }
        }, '-',
        {
            text: 'Select color',
            menu: {
                indent: false,
                items: [{
                    text: 'Blue',
                    handler: function () {
                        var radio = Ext.getCmp('radio4');
                        radio.setValue(true);
                    }
                }, {
                    text: 'Grey',
                    handler: function () {
                        var radio = Ext.getCmp('radio5');
                        radio.setValue(true);
                    }
                }, {
                    text: 'Black',
                    handler: function () {
                        var radio = Ext.getCmp('radio6');
                        radio.setValue(true);
                    }
                }]
            }
        }]
    });
});

===============================================================================================

Field.Spinner

/*global Ext:false */
Ext.onReady(function () {
    Ext.define('Ext.ux.CustomSpinner', {
        extend: 'Ext.form.field.Spinner',
        alias: 'widget.customspinner',

        // override onSpinUp (using step isn't neccessary)
        onSpinUp: function () {
            var me = this;
            if (!me.readOnly) {
                var val = parseInt(me.getValue().split(' '), 10) || 0; // gets rid of " Pack", defaults to zero on parse failure
                me.setValue((val + me.step) + ' Pack');
            }
        },

        // override onSpinDown
        onSpinDown: function () {
            var me = this;
            if (!me.readOnly) {
                var val = parseInt(me.getValue().split(' '), 10) || 0; // gets rid of " Pack", defaults to zero on parse failure
                if (val <= me.step) {
                    me.setValue('Dry!');
                } else {
                    me.setValue((val - me.step) + ' Pack');
                }
            }
        }
    });

    Ext.create('Ext.form.FormPanel', {
        title: 'Form with SpinnerField',
        bodyPadding: 5,
        width: 350,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'customspinner',
            fieldLabel: 'How Much Beer?',
            step: 6
        }]
    });
});


==================================================================================================

Field.Text1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'Contact Info',
        width: 300,
        bodyPadding: 10,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'textfield',
            name: 'name',
            fieldLabel: 'Name',
            allowBlank: false // requires a non-empty value
        }, {
            xtype: 'textfield',
            name: 'email',
            fieldLabel: 'Email Address',
            vtype: 'email' // requires value to be a valid email address format
        }]
    });
});

===================================================================================================

Field.TestArea1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.FormPanel', {
        title: 'Sample TextArea',
        width: 400,
        bodyPadding: 10,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'textareafield',
            grow: true,
            name: 'message',
            fieldLabel: 'Message',
            anchor: '100%'
        }]
    });
});

==================================================================================================

Field.Time1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'Time Card',
        width: 300,
        bodyPadding: 10,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'timefield',
            name: 'in',
            fieldLabel: 'Time In',
            minValue: '6:00 AM',
            maxValue: '8:00 PM',
            increment: 30,
            anchor: '100%'
        }, {
            xtype: 'timefield',
            name: 'out',
            fieldLabel: 'Time Out',
            minValue: '6:00 AM',
            maxValue: '8:00 PM',
            increment: 30,
            anchor: '100%'
        }]
    });
});

====================================================================================================

Field.Trigger1

/*global Ext:false */
Ext.onReady(function () {
    Ext.define('Ext.ux.CustomTrigger', {
        extend: 'Ext.form.field.Trigger',
        alias: 'widget.customtrigger',

        // override onTriggerClick
        onTriggerClick: function () {
            Ext.Msg.alert('Status', 'You clicked my trigger!');
        }
    });

    Ext.create('Ext.form.FormPanel', {
        title: 'Form with TriggerField',
        bodyPadding: 5,
        width: 350,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'customtrigger',
            fieldLabel: 'Sample Trigger',
            emptyText: 'click the trigger'
        }]
    });
});

=======================================================================================================

Form.Fieldcontainer

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'FieldContainer Example',
        width: 550,
        bodyPadding: 10,

        items: [{
            xtype: 'fieldcontainer',
            fieldLabel: 'Last Three Jobs',
            labelWidth: 100,

            // The body area will contain three text fields, arranged
            // horizontally, separated by draggable splitters.
            layout: 'hbox',
            items: [{
                xtype: 'textfield',
                flex: 1
            }, {
                xtype: 'splitter'
            }, {
                xtype: 'textfield',
                flex: 1
            }, {
                xtype: 'splitter'
            }, {
                xtype: 'textfield',
                flex: 1
            }]
        }],
        renderTo: Ext.getBody()
    });
});

=========================================================================================================

Form.Fieldset1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'Simple Form with FieldSets',
        labelWidth: 75,
        // label settings here cascade unless overridden
        url: 'save-form.php',
        frame: true,
        bodyStyle: 'padding:5px 5px 0',
        width: 550,
        renderTo: Ext.getBody(),
        layout: 'column',
        // arrange fieldsets side by side
        items: [{
            // Fieldset in Column 1 - collapsible via toggle button
            xtype: 'fieldset',
            columnWidth: 0.5,
            title: 'Fieldset 1',
            collapsible: true,
            defaultType: 'textfield',
            defaults: {
                anchor: '100%'
            },
            layout: 'anchor',
            items: [{
                fieldLabel: 'Field 1',
                name: 'field1'
            }, {
                fieldLabel: 'Field 2',
                name: 'field2'
            }]
        }, {
            // Fieldset in Column 2 - collapsible via checkbox, collapsed by default, contains a panel
            xtype: 'fieldset',
            title: 'Show Panel',
            // title or checkboxToggle creates fieldset header
            columnWidth: 0.5,
            checkboxToggle: true,
            collapsed: true,
            // fieldset initially collapsed
            layout: 'anchor',
            items: [{
                xtype: 'panel',
                anchor: '100%',
                title: 'Panel inside a fieldset',
                frame: true,
                height: 52
            }]
        }]
    });
});

=====================================================================================================

Form.Label1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'Field with Label',
        width: 400,
        bodyPadding: 10,
        renderTo: Ext.getBody(),
        layout: {
            type: 'hbox',
            align: 'middle'
        },
        items: [{
            xtype: 'textfield',
            hideLabel: true,
            flex: 1
        }, {
            xtype: 'label',
            forId: 'myFieldId',
            text: 'My Awesome Field',
            margin: '0 0 0 10'
        }]
    });
});


======================================================================================================

Form.panel1

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'Simple Form',
        bodyPadding: 5,
        width: 350,

        // The form will submit an AJAX request to this URL when submitted
        url: 'save-form.php',

        // Fields will be arranged vertically, stretched to full width
        layout: 'anchor',
        defaults: {
            anchor: '100%'
        },

        // The fields
        defaultType: 'textfield',
        items: [{
            fieldLabel: 'First Name',
            name: 'first',
            allowBlank: false
        }, {
            fieldLabel: 'Last Name',
            name: 'last',
            allowBlank: false
        }],

        // Reset and Submit buttons
        buttons: [{
            text: 'Reset',
            handler: function () {
                this.up('form').getForm().reset();
            }
        }, {
            text: 'Submit',
            formBind: true,
            //only enabled once the form is valid
            disabled: true,
            handler: function () {
                var form = this.up('form').getForm();
                if (form.isValid()) {
                    form.submit({
                        success: function (form, action) {
                            Ext.Msg.alert('Success', action.result.msg);
                        },
                        failure: function (form, action) {
                            Ext.Msg.alert('Failed', action.result.msg);
                        }
                    });
                }
            }
        }],
        renderTo: Ext.getBody()
    });
});

====================================================================================================

Form.RadioGroup

/*global Ext:false */
Ext.onReady(function () {
    Ext.create('Ext.form.Panel', {
        title: 'RadioGroup Example',
        width: 300,
        height: 125,
        bodyPadding: 10,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'radiogroup',
            fieldLabel: 'Two Columns',
            // Arrange radio buttons into two columns, distributed vertically
            columns: 2,
            vertical: true,
            items: [{
                boxLabel: 'Item 1',
                name: 'rb',
                inputValue: '1'
            }, {
                boxLabel: 'Item 2',
                name: 'rb',
                inputValue: '2',
                checked: true
            }, {
                boxLabel: 'Item 3',
                name: 'rb',
                inputValue: '3'
            }, {
                boxLabel: 'Item 4',
                name: 'rb',
                inputValue: '4'
            }, {
                boxLabel: 'Item 5',
                name: 'rb',
                inputValue: '5'
            }, {
                boxLabel: 'Item 6',
                name: 'rb',
                inputValue: '6'
            }]
        }]
    });
});





Saturday, 11 July 2015

XMLTYPE Example

PROCEDURE aud_s023_s020_a023(lt_in_data_orig    IN CLOB,
                               lt_in_data         IN OUT CLOB,
                               lt_out_data        IN OUT CLOB,
                               pc_process_code    IN VARCHAR2,
                               lc_from_stage      IN VARCHAR2,
                               lc_to_stage        IN VARCHAR2,
                               xn_error_handle_id IN OUT NUMBER,
                               xn_error_seq       IN OUT NUMBER,
                               xn_error_code      OUT VARCHAR2) IS
    lc_audit_id           ms_aud_audit.audit_id%TYPE;
    lc_doc_id             ms_aud_audit_doc.do_id%TYPE;
    lc_contact_id         ms_aud_audit_con.co_contact_id%TYPE;
    lc_initiator          ms_aud_audit.initiator%TYPE;
    lc_action             ms_aud_audit.audit_action%TYPE;
    lc_status             ms_aud_audit.status%TYPE;
    lc_error_message      varchar2(4000);
    lc_object_type        ms_aud_audit.dd_object_type%type;
    lc_pid                ms_aud_audit.dd_process_instance_id%type;
    lc_submit_status      ms_aud_audit.submit_status%type;
    lc_milestone_template ms_aud_audit.milestone_template%type;
    lc_modulename         VARCHAR2(100) := '[ ms_aud_f003_helper.aud_s023_s020_a023 ] ';
    lc_out_xml            XMLTYPE;
    O_Next_Id      Varchar2(4000);
    Process_Inst_Id Number;
    O_Error_Code   Number;
    O_Error_Message Varchar2(4000);
  BEGIN
    lc_out_xml := XMLTYPE(lt_in_data);

    ---- Deleting Blank Record
    lc_out_xml := ms_aud_utilities.deletenode(lc_out_xml,
                                              'con',
                                              'co_user_in_system',
                                              gc_data_namespace);
    lc_out_xml := ms_aud_utilities.deletenode(lc_out_xml,
                                              'doc',
                                              'do_type',
                                              gc_data_namespace);
    lc_out_xml := ms_aud_utilities.deletenode(lc_out_xml,
                                              'kms',
                                              'km_milestones',
                                              gc_data_namespace);
    lc_out_xml := ms_aud_utilities.update_instance(lc_out_xml,
                                                   gc_data_namespace);

    ms_apps_mdf_errors_pkg.insert_log(pn_error_handle_id => xn_error_handle_id,
                                      pn_error_sequence  => xn_error_seq,
                                      pc_error_type      => 'LOG',
                                      pc_error_text      => lc_modulename ||
                                                            'Inside ms_aud_f003_helper.aud_s020_s022_a002 before data manipulation');

    IF UPPER(lc_from_stage) = 'INITIATE_AUDIT' AND
       UPPER(lc_to_stage) = 'CREATE_AUDIT' THEN
      SELECT UPDATEXML(lc_out_xml,
                       'datapacket/data/nonmultirow/previous_stage/text()',
                       '23',
                       gc_data_namespace)
        INTO lc_out_xml
        FROM DUAL;
 
      SELECT UPDATEXML(lc_out_xml,
                       'datapacket/data/nonmultirow/dd_current_stage/text()',
                       '20',
                       gc_data_namespace)
        INTO lc_out_xml
        FROM DUAL;
 
      ---- Audit ID Generation
      select lc_out_xml.extract('datapacket/data/nonmultirow/audit_id/text()', gc_data_namespace)
             .getstringval(),
             lc_out_xml.extract('datapacket/data/nonmultirow/dd_object_type/text()', gc_data_namespace)
             .getstringval(),
             lc_out_xml.extract('datapacket/data/nonmultirow/process_instance_id/text()', gc_data_namespace)
             .getstringval(),
             lc_out_xml.extract('datapacket/data/nonmultirow/submit_status/text()', gc_data_namespace)
             .getstringval(),
             lc_out_xml.extract('datapacket/data/nonmultirow/milestone_template/text()', gc_data_namespace)
             .getstringval()
        INTO lc_audit_id,
             lc_object_type,
             lc_pid,
             lc_submit_status,
             lc_milestone_template
        FROM DUAL;
 
      IF lc_audit_id = '0' OR lc_audit_id IS NULL THEN
   
        /* SELECT ms_aud_audit_id_s.NEXTVAL
        INTO lc_audit_id
        FROM DUAL;*/
   
        lc_audit_id := ms_aud_components.ms_aud_generate_id(lc_object_type,
                                                            'AUDIT_ID',
                                                            lc_pid);
   
        SELECT UPDATEXML(lc_out_xml,
                         'datapacket/data/nonmultirow/audit_id/text()',
                         lc_audit_id,
                         gc_data_namespace)
          INTO lc_out_xml
          FROM DUAL;
   
      END IF;
      ---- End of Audit ID Generation
 
      ---- Contact multirow block
      FOR rec_con IN (SELECT CO_CONTACT_ID, INSTANCE_REC_NUM
                        FROM XMLTABLE(XMLNAMESPACES('http://www.metricstream.com/appstudio/msa' as
                                                    "msa"),
                                      'msa:datapacket/msa:data/msa:con/msa:row'
                                      PASSING lc_out_xml COLUMNS
                                      CO_CONTACT_ID NUMBER PATH
                                      'msa:co_contact_id',
                                      INSTANCE_REC_NUM NUMBER PATH
                                      'msa:instance_rec_num')) LOOP
        ---- Contact ID Generation
        IF rec_con.co_contact_id = 0 OR rec_con.co_contact_id IS NULL THEN
          SELECT ms_aud_audit_contact_id_s.NEXTVAL
            INTO lc_contact_id
            FROM DUAL;
     
          SELECT UPDATEXML(lc_out_xml,
                           'datapacket/data/con/row[instance_rec_num="' ||
                           rec_con.instance_rec_num ||
                           '"]/co_contact_id/text()',
                           lc_contact_id,
                           gc_data_namespace)
            INTO lc_out_xml
            FROM DUAL;
        END IF;
      END LOOP;
      ---- End Contact multirow block
 
      ---- Doc multirow block
      FOR rec_doc IN (SELECT DO_ID, INSTANCE_REC_NUM
                        FROM XMLTABLE(XMLNAMESPACES('http://www.metricstream.com/appstudio/msa' as
                                                    "msa"),
                                      'msa:datapacket/msa:data/msa:doc/msa:row'
                                      PASSING lc_out_xml COLUMNS DO_ID
                                      VARCHAR2(50) PATH 'msa:do_id',
                                      INSTANCE_REC_NUM NUMBER PATH
                                      'msa:instance_rec_num')) LOOP
        ---- Doc ID Generation
        IF rec_doc.do_id = '0' OR rec_doc.do_id IS NULL THEN
          SELECT ms_aud_doc_id_s.NEXTVAL INTO lc_doc_id FROM DUAL;
     
          SELECT UPDATEXML(lc_out_xml,
                           'datapacket/data/doc/row[instance_rec_num="' ||
                           rec_doc.instance_rec_num || '"]/do_id/text()',
                           lc_doc_id,
                           gc_data_namespace)
            INTO lc_out_xml
            FROM DUAL;
        END IF;
      END LOOP;
      ---- End Doc multirow block
 
   ---- pl_log multirow block
       FOR rec_pl_log IN (SELECT PL_ID, INSTANCE_REC_NUM
                        FROM XMLTABLE(XMLNAMESPACES('http://www.metricstream.com/appstudio/msa' as
                                                    "msa"),
                                      'msa:datapacket/msa:data/msa:pro/msa:row'
                                      PASSING lc_out_xml COLUMNS PL_ID
                                      VARCHAR2(50) PATH 'msa:pl_id',
                                      INSTANCE_REC_NUM NUMBER PATH
                                      'msa:instance_rec_num')) LOOP
        ---- Proceeding log ID Generation
        IF rec_pl_log.pl_id = '0' or rec_pl_log.pl_id IS NULL THEN
     
        Select Xmltype(Lt_In_Data_Orig).Extract('datapacket/data/nonmultirow/instance_id/text()', 'xmlns="http://www.metricstream.com/appstudio/msa"').getNumberVal() Into Process_Inst_Id From Dual;
     
        Ms_Apps_Utilities.Get_Next_Id('AUD','MS_AUD_PL_LOG',' ',Process_Inst_Id,O_Next_Id,O_Error_Code,O_Error_Message);
             
                cboe_error_log(Process_Inst_Id,'MS_AUD_PL_LOG',O_Next_Id,Process_Inst_Id);
             
          SELECT UPDATEXML(lc_out_xml,
                           'datapacket/data/pro/row[instance_rec_num="' ||
                           rec_pl_log.instance_rec_num || '"]/pl_id',
                           xmltype('<msa:pl_id xmlns:msa="http://www.metricstream.com/appstudio/msa">' ||
                                   O_Next_Id || '</msa:pl_id>'),
                           gc_data_namespace)
            INTO LC_OUT_XML
            FROM DUAL;
        END IF;
      END LOOP;
      ---- End pl_log multirow block  
 
      ---- Assigning the initiator Start
      lc_initiator := ms_aud_utilities.fn_get_xml_value('initiator',
                                                        lc_out_xml,
                                                        gc_data_namespace);
 
      IF lc_initiator = '0' THEN
        lc_initiator := ms_aud_utilities.fn_get_xml_value('dd_current_user_name',
                                                          lc_out_xml,
                                                          gc_data_namespace);
        SELECT UPDATEXML(lc_out_xml,
                         'datapacket/data/nonmultirow/initiator/text()',
                         lc_initiator,
                         gc_data_namespace)
          INTO lc_out_xml
          FROM DUAL;
      END IF;
      ---- Assigning the initiator End
 
      IF ((lc_submit_status = '0' OR lc_submit_status IS NULL)) THEN
        SELECT UPDATEXML(lc_out_xml,
                         'datapacket/data/nonmultirow/submit_status',
                         xmltype('<msa:submit_status xmlns:msa="http://www.metricstream.com/appstudio/msa">' || '1' ||
                                 '</msa:submit_status>'),
                         gc_data_namespace)
          INTO lc_out_xml
          FROM DUAL;
      END IF;
 
      IF ((lc_submit_status != '0' OR lc_submit_status IS NOT NULL) AND
         lc_milestone_template IS NOT NULL) THEN
        SELECT UPDATEXML(lc_out_xml,
                         'datapacket/data/nonmultirow/submit_status',
                         xmltype('<msa:submit_status xmlns:msa="http://www.metricstream.com/appstudio/msa">' || '2' ||
                                 '</msa:submit_status>'),
                         gc_data_namespace)
          INTO lc_out_xml
          FROM DUAL;
      END IF;
 
      ---- Populate Status information Start        
      SELECT lc_out_xml.EXTRACT('datapacket/data/nonmultirow/audit_action/text()', gc_data_namespace)
             .getstringval()
        INTO lc_action
        FROM DUAL;
 
      lc_status := ms_aud_utilities.fn_get_status(20, 23, lc_action);
 
      SELECT UPDATEXML(lc_out_xml,
                       'datapacket/data/nonmultirow/status/text()',
                       lc_status,
                       gc_data_namespace)
        INTO lc_out_xml
        FROM DUAL;
      ---- Populate Status information End
 
      ms_aud_utilities.process_comments_history(i_key_col_value => ms_aud_utilities.fn_get_xml_value('audit_id',
                                                                                                     lc_out_xml,
                                                                                                     gc_data_namespace),
                                                i_comments      => ms_aud_utilities.fn_get_xml_value('audit_comments',
                                                                                                     lc_out_xml,
                                                                                                     gc_data_namespace),
                                                i_process_step  => ms_aud_utilities.fn_get_xml_value('dd_current_stage',
                                                                                                     lc_out_xml,
                                                                                                     gc_data_namespace),
                                                i_user_name     => ms_aud_utilities.fn_get_xml_value('dd_current_user_name',
                                                                                                     lc_out_xml,
                                                                                                     gc_data_namespace),
                                                i_status        => ms_aud_utilities.fn_get_xml_value('status',
                                                                                                     lc_out_xml,
                                                                                                     gc_data_namespace),
                                                i_action        => ms_aud_utilities.fn_get_xml_value('audit_action',
                                                                                                     lc_out_xml,
                                                                                                     gc_data_namespace),
                                                i_key_col_name  => 'AUDIT_ID',
                                                i_rtf_attach    => NULL,
                                                i_form_name     => 'MANAGE AUDIT',
                                                o_error_code    => xn_error_code,
                                                o_error_message => lc_error_message);
 
      /*SELECT UPDATEXML(lc_out_xml,
                       'datapacket/data/nonmultirow/audit_comments/text()',
                       ' ',
                       gc_data_namespace)
        INTO lc_out_xml
        FROM DUAL;*/
    END IF;

    lt_out_data := lc_out_xml.getclobval();
    lt_in_data  := lc_out_xml.getclobval();

    ms_apps_mdf_errors_pkg.insert_log(pn_error_handle_id => xn_error_handle_id,
                                      pn_error_sequence  => xn_error_seq,
                                      pc_error_type      => 'LOG',
                                      pc_error_text      => lc_modulename ||
                                                            'End of ms_aud_f003_helper.aud_s023_s023_a023');
  END aud_s023_s020_a023;
  

Oracle Interview Questions

 1. Difference between varchar and varchar2 data types?

Varchar can store upto 2000 bytes and varchar2 can store upto 4000 bytes. Varchar will occupy space for NULL values and Varchar2 will not occupy any space. Both are differed with respect to space.

2. In which language Oracle has been developed?

Oracle has been developed using C Language.

 3. What is RAW datatype?

RAW datatype is used to store values in binary data format. The maximum size for a raw in a table in 32767 bytes.

4. What is the use of NVL function?

The NVL function is used to replace NULL values with another or given value. Example is –

NVL(Value, replace value)

5. Whether any commands are used for Months calculation? If so, What are they?

In Oracle, months_between function is used to find number of months between the given dates. Example is –

Months_between(Date 1, Date 2)

6. What are nested tables?

   Nested table is a data type in Oracle which is used to support columns containing multi valued attributes. It also hold entire sub table.

7. What is COALESCE function?

COALESCE function is used to return the value which is set to be not null in the list. If all values in the list are null, then the coalesce function will return NULL.

Coalesce(value1, value2,value3,…)

8. What is BLOB datatype?

A BLOB data type is a varying length binary string which is used to store two gigabytes memory. Length should be specified in Bytes for BLOB.

9. How do we represent comments in Oracle?

Comments in Oracle can be represented in two ways –

Two dashes(–) before beginning of the line – Single statement
/*—— */ is used to represent it as comments for block of statement
10. What is DML?

Data Manipulation Language (DML) is used to access and manipulate data in the existing objects.  DML statements are insert, select, update and delete and it won’t implicitly commit the current transaction.

11. What is the difference between TRANSLATE and REPLACE?

Translate is used for character by character substitution and Replace is used substitute a single character with a word.

12. How do we display rows from the table without duplicates?

Duplicate rows can be removed by using the keyword DISTINCT in the select statement.

13. What is the usage of Merge Statement?

Merge statement is used to select rows from one or more data source for updating and insertion into a table or a view. It is used to combine multiple operations.

14. What is NULL value in oracle?

NULL value represents missing or unknown data. This is used as a place holder or represented it in as default entry to indicate that there is no actual data present.

15. What is USING Clause and give example?

The USING clause is used to specify with the column to test for equality when two tables are joined.

[sql]Select * from employee join salary using employee ID[/sql]

Employee tables join with the Salary tables with the Employee ID.

16. What is key preserved table?

A table is set to be key preserved table if every key of the table can also be the key of the result of the join. It guarantees to return only one copy of each row from the base table.

17. What is WITH CHECK OPTION?

The WITH CHECK option clause specifies check level to be done in DML statements. It is used to prevent changes to a view that would produce results that are not included in the sub query.

18. What is the use of Aggregate functions in Oracle?

Aggregate function is a function where values of multiple rows or records are joined together to get a single value output. Common aggregate functions are –

Average
Count
Sum
19. What do you mean by GROUP BY Clause?

A GROUP BY clause can be used in select statement where it will collect data across multiple records and group the results by one or more columns.

20. What is a sub query and what are the different types of subqueries?

Sub Query is also called as Nested Query or Inner Query which is used to get data from multiple tables. A sub query is added in the where clause of the main query.

There are two different types of subqueries:

Correlated sub query
A Correlated sub query cannot be as independent query but can reference column in a table listed in the from list of the outer query.

Non-Correlated subquery
This can be evaluated as if it were an independent query. Results of the sub query are submitted to the main query or parent query.

21. What is cross join?

Cross join is defined as the Cartesian product of records from the tables present in the join. Cross join will produce result which combines each row from the first table with the each row from the second table.

22. What are temporal data types in Oracle?

Oracle provides following temporal data types:

Date Data Type – Different formats of Dates
TimeStamp Data Type – Different formats of Time Stamp
Interval Data Type – Interval between dates and time
23. How do we create privileges in Oracle?

A privilege is nothing but right to execute an SQL query or to access another user object. Privilege can be given as system privilege or user privilege.

[sql]GRANT user1 TO user2 WITH MANAGER OPTION;[/sql]

24. What is VArray?

VArray is an oracle data type used to have columns containing multivalued attributes and it can hold bounded array of values.

25. How do we get field details of a table?

Describe <Table_Name> is used to get the field details of a specified table.

26. What is the difference between rename and alias?

Rename is a permanent name given to a table or a column whereas Alias is a temporary name given to a table or column. Rename is nothing but replacement of name and Alias is an alternate name of the table or column.

27. What is a View?

View is a logical table which based on one or more tables or views.  The tables upon which the view is based are called Base Tables and it doesn’t contain data.

28. What is a cursor variable?

A cursor variable is associated with different statements which can hold different values at run time. A cursor variable is a kind of reference type.

29. What are cursor attributes?

Each cursor in Oracle has set of attributes which enables an application program to test the state of the cursor. The attributes can be used to check whether cursor is opened or closed, found or not found and also find row count.

30. What are SET operators?

SET operators are used with two or more queries and those operators are Union, Union All, Intersect and Minus.

31. How can we delete duplicate rows in a table?

Duplicate rows in the table can be deleted by using ROWID.

32. What are the attributes of Cursor?

Attributes of Cursor are

%FOUND
Returns NULL if cursor is open and fetch has not been executed

Returns TRUE if the fetch of cursor is executed successfully.

Returns False if no rows are returned.

%NOT FOUND
Returns NULL if cursor is open and fetch has not been executed

Returns False if fetch has been executed

Returns True if no row was returned

%ISOPEN
Returns true if the cursor is open

Returns false if the cursor is closed

%ROWCOUNT
Returns the number of rows fetched. It has to be iterated through entire cursor to give exact real count.

33. Can we store pictures in the database and if so, how it can be done?

Yes, we can store pictures in the database by Long Raw Data type. This datatype is used to store binary data for 2 gigabytes of length. But the table can have only on Long Raw data type.

34. What is an integrity constraint?

An integrity constraint is a declaration defined a business rule for a table column. Integrity constraints are used to ensure accuracy and consistency of data in a database. There are types – Domain Integrity, Referential Integrity and Domain Integrity.

35. What is an ALERT?

An alert is a window which appears in the center of the screen overlaying a portion of the current display.

36. What is hash cluster?

Hash Cluster is a technique used to store the table for faster retrieval. Apply hash value on the table to retrieve the rows from the table.

37. What are the various constraints used in Oracle?

Following are constraints used:

NULL – It is to indicate that particular column can contain NULL values
NOT NULL – It is to indicate that particular column cannot contain NULL values
CHECK – Validate that values in the given column to meet the specific criteria
DEFAULT – It is to indicate the value is assigned to default value
38. What is difference between SUBSTR and INSTR?

SUBSTR returns specific portion of a string and INSTR provides character position in which a pattern is found in a string.

SUBSTR returns string whereas INSTR returns numeric.

39. What is the parameter mode that can be passed to a procedure?

IN, OUT and INOUT are the modes of parameters that can be passed to a procedure.

40. What are the different Oracle Database objects?

There are different data objects in Oracle –

Tables – set of elements organized in vertical and horizontal
Views  – Virtual table derived from one or more tables
Indexes – Performance tuning method for processing the records
Synonyms – Alias name for tables
Sequences – Multiple users generate unique numbers
Tablespaces – Logical storage unit in Oracle
41. What are the differences between LOV and List Item?

LOV is property whereas list items are considered as single item. List of items is set to be a collection of list of items. A list item can have only one column, LOV can have one or more columns.

42. What are privileges and Grants?

Privileges are the rights to execute SQL statements – means Right to connect and connect. Grants are given to the object so that objects can be accessed accordingly. Grants can be provided by the owner or creator of an object.

43. What is the difference between $ORACLE_BASE and $ORACLE_HOME?

Oracle base is the main or root directory of an oracle whereas ORACLE_HOME is located beneath base folder in which all oracle products reside.

44. What is the fastest query method to fetch data from the table?

Row can be fetched from table by using ROWID. Using ROW ID is the fastest query method to fetch data from the table.

45. What is the maximum number of triggers that can be applied to a single table?

12 is the maximum number of triggers that can be applied to a single table.

46. How to display row numbers with the records?

Display row numbers with the records numbers –


1
Select rownum, <fieldnames> from table;
This query will display row numbers and the field values from the given table.

47. How can we view last record added to a table?

Last record can be added to a table and this can be done by –


1
Select * from (select * from employees order by rownum desc) where rownum<2;


48. What is the data type of DUAL table?

The DUAL table is a one-column table present in oracle database.  The table has a single VARCHAR2(1) column called DUMMY which has a value of ‘X’.

49. What is difference between Cartesian Join and Cross Join?

There are no differences between the join. Cartesian and Cross joins are same. Cross join gives cartesian product of two tables – Rows from first table is multiplied with another table which is called cartesian product.

Cross join without where clause gives Cartesian product.

50. How to display employee records who gets more salary than the average salary in the department?

This can be done by this query –


1
Select * from employee where salary>(select avg(salary) from dept, employee where dept.deptno = employee.deptno