Monday, February 22, 2010

JavaScript

User functions for Developing Dynamic UI pages in Javascript...

To display the Properties of an element. This is very useful function to know what all the properties are exist (can be selected) on given element.
function displayProperties(ele){
var prop = "";
for(att in ele){
prop += att + "::"+ ele[att] +"\n";
}
alert(prop);
}
The output would be :
language::
scrollHeight::18
isTextEdit::true
currentStyle::[object]
document::[object]
onmouseup::null
oncontextmenu::null
isMultiLine::false
clientHeight::18
onrowexit::null
onbeforepaste::null
onactivate::null
scrollLeft::0
lang::
onmousemove::null
onmove::null
onselectstart::null
parentTextEdit::[object]
oncontrolselect::null
canHaveHTML::false
onkeypress::null
oncut::null
onrowenter::null
onmousedown::null
onpaste::null
className::
id::Country Name
onreadystatechange::null
onbeforedeactivate::null
hideFocus::false
dir::

etc...


Events can be attached to an element dynamically.

window.attachEvent('onload', function() { showBtn(formName, eleName); });

The above snippet would append the event to window. If there is any existing onload functions then it would call them first and later it will call above function (i.e. showBtn()).





Saturday, July 11, 2009

MQL Commands

List of MQL commands on a business object. In all commands, T means type, N means Name, and R means revision of the business object.

To add a business object.
MQL<1> add bus T N R policy <policyName> vault <vaultName>

To add a business object and updating the attributes in a single command.
MQL<2> add bus T N R policy <policyName> vault <vaultName> "attribute name 1" "attribute 1 value" "attribute name 2" "attribute 2 value"

To find the number business objects by using temp query bus.
MQL<3>eval expr ' count true ' on temp query bus "Complaint" * * where " originated > '01/01/2009' ";
549

To find the number business objects that are connected to a business object.
MQL<3>eval expr ' count true ' on expand bus Complaint CPT090000011 1;
7

To know the current context
MQL<4>print context;
context vault eService Production person Test Everything

To know how many users connected to eMatrix (sesssions).
MQL<13>sessions;
HimnishTechnologies\parin HimnishTechnologies\HT00001 mql.exe
HimnishTechnologies\parin HimnishTechnologies\HT00001 mql.exe
HimnishTechnologies\ajay HimnishTechnologies\HT00002 business.exe


To monitor memory usage...
MQL<21>monitor memory

Used heap 1689786 bytes, free heap 43008 bytes.

Matrix Memory Manager:

547220 bytes of memory allocated in 46 blocks, highwater= 570272 bytes
0 bytes of memory reserved in 0 blocks
JVM total memory: 5177344
JVM max memory: 133234688
JVM free memory: 4489456
JVM memory in use: 687888
JVM available processors: 2

To know version of the software installed...
MQL<22>version;
V6R2009x.HF29




will add many more soon...

Thursday, July 9, 2009

Add an object to an existing revision sequence

Below command allows to add one object to another object as a revision.

revise bus T N R1 bus T N R2 ;

For example: Create 2 parts with same name, and revision with 1, and 42. (NOTE: No need to have same name or type)
MQL<1>add bus Part Nut 1 policy 'EC Part' vault 'eService Administration';
MQL<2>add bus Part Nut 42 policy 'EC Part' vault 'eService Administration';
MQL<3>print bus Part Nut 1 select revision next;
business object Part Nut 1
revisions = 1
next =
MQL<4> revise bus Part Nut 1 bus Part Nut 42;
MQL<5> print bus Part Nut 1 select revisions next;
business object Part Nut 1
revisions = 1
revisions = 42
next = 42