Wednesday, December 17, 2008

Easy Syntax with WLST

WLST is a powerful scripting solution for managing and administering WebLogic Server and resources deployed on them. WLST is built on the Java implementation of the scripting language Python called as Jython. All the commands in WLST are implemented as Jython functions and they require a set of parentheses for passing any arguments. Even any commands that do not require any arguments are supposed to be suffixed with parentheses. For example the command "ls" is used to list all the child MBeans and/or attributes of the current MBean you are at.

ls() - lists all the child MBeans and attributes
ls('a') - lists all the attribute names and values only
ls('c') - lists all the child MBeans only

So even if you want to invoke "ls" with no arugments you must use "ls()". This might not be an issue when you are building scripts that you might want to run many times. But while connected to a server and working with WLST in interactive mode, it might get a little frustated to type the parentheses everytime you want to run some simple commands with no arguments. To ease this pain there is a hidden option in WLST which can be used to ease the syntax for WLST commands - easeSyntax().



You can supply the "easeSyntax()" command to ease the syntax but this is not recommended for script mode and especially when using loop constructs. You can also use the regular Jython syntax with parentheses even after you enabled the easy syntax. To turn off the easy syntax mode simply issue the command again "easeSyntax".

Bye Bye parentheses!

6 comments:

  1. easeSyntax() doesn't work with all commands, try with with edit() or serverConfig().

    also how about using it for 2 arguments? did anyone figure out how to do a
    set ListenPort 9999
    instead of set('ListenPort','9999')?

    IMHO it would be nice to have some TAB-completion of commands, or CTRL-Space for the Eclipse junkies.
    Even DOS can do this now. Come on it is Y2009 :-)

    don't get me wrong. I am big fan of WLST but there is much space for improvement also.

    maybe a python plugin configured into Eclipse/Workhop was a good start for Oracle to improve this.

    best wishes,

    Frank

    ReplyDelete
  2. Take a look at JyDT (http://www.redrobinsoftware.net/jydt/)which is a plug-in to do Jython from Eclipse. You should be able to do WLST from this as well. I shall write a separate blog entry with more detail soon.

    ReplyDelete
  3. have you been able to get JyDT to work with Workshop 10gR3? The plugin worked fine with Workshop 9.x for couple of years, but I get an error trying to install it in Workshop 10gR3: "WebLogic Portal (10.3.0) requires feature "com.m7.nitrox (1.0.20)", or compatible." I would be interested to know if you have different results. Thanks.

    ReplyDelete
  4. recipe for old fashioned tomato pie http://www.thefashionhouse.us/38-roberto-cavalli-size24.html virtual kitchen designer [url=http://www.thefashionhouse.us/?action=products&product_id=1999]fashion games for teens[/url] preteen fashion galleries
    http://www.thefashionhouse.us/dark-denim-blue-on-sale-color165.html snow shoes [url=http://www.thefashionhouse.us/on-sale-leather-jacket-type2.html]shoes boots western childrens[/url]

    ReplyDelete
  5. flu jab die ill rely scientist year britain drugs kills [url=http://usadrugstoretoday.com/products/generic-keflex.htm]generic keflex[/url] harvey keats westchester square medical center http://usadrugstoretoday.com/products/triphala.htm
    normal fasting rate for blood sugar [url=http://usadrugstoretoday.com/products/menopause-gum.htm]menopause gum[/url] fatigue restless leg syndrome [url=http://usadrugstoretoday.com/categories/anti-alergica-y-el-asma.htm ]health and safety quizzes with answers [/url] dui blood test california
    diagnosis medical symptoms you have [url=http://usadrugstoretoday.com/products/cytotec.htm]cytotec[/url] items for the penis http://usadrugstoretoday.com/products/calcium-carbonate.htm
    australia pharmacy online [url=http://usadrugstoretoday.com/products/cleocin-gel.htm]cleocin gel[/url] smoking room distingished [url=http://usadrugstoretoday.com/products/procardia.htm ]multiple orgasms with viagra [/url] mass health dma

    ReplyDelete
  6. pics of the urinary system [url=http://usadrugstoretoday.com/categories/cardiovascolari.htm]cardiovascolari[/url] black men and vitamin d http://usadrugstoretoday.com/products/cialis-soft-tabs.htm
    dental practice management [url=http://usadrugstoretoday.com/products/terramycin.htm]terramycin[/url] viagra pharmacy stop [url=http://usadrugstoretoday.com/catalogue/x.htm ]effects of a aspirin overdose [/url] mn dental care richfield
    low blood sugar rapid heart rate [url=http://usadrugstoretoday.com/categories/gastrointestinal.htm]gastrointestinal[/url] pregnancy diet nutrition http://usadrugstoretoday.com/categories/gastrointestinal.htm
    short broken heart poems [url=http://usadrugstoretoday.com/bestsellers.htm]Pharmacy bestsellers[/url] veronnika zemanova breast implants [url=http://usadrugstoretoday.com/products/triphala.htm ]removing fluid congestive heart failure [/url] abilify a treatment option for bipolar 1 disorder

    ReplyDelete