WLST Offline and Replacement Variables

Hello.
I'm having a problem where when I'm using WLST to create a domain from a template with an application in it, it writes the application out to the default <BEA_HOME>/user_projects/... as opposed to under the domain directory specified in the wl.writeDomain("/mydomains_dir/mynewdomain" ) command.
The /AppDeployment/mystdapp/SourcePath is set to $APPLICATIONS_DIRECTORY$/myappsdir/mystdapp.war
I even tried to change the $APPLICATIONS_DIRECTORY$ to $DOMAIN_HOME$
but to no avail.
Can you not use the tags?
Is there an API I'm not finding the docs on that tell you how to set those tags to something other than the default before writing out the domain to get it to work???
Any help at all would be very much appreciated. I've been searching the docs for days.
tia,
Ed Ludke
Bank of America
[email protected]
(delete NOSPAM from above email address for valid address)

Satya,
Thanks so much for responding!
I don't believe the problem is in the script because all I'm doing is loading a template and then writting it out as a domain to my own target dir.
Regardless, below is a working sample of what I'm talking about.
To use this script with the medrec template for example (found in $WL_HOME/common/templates/applications/medrec.jar), use the following entries in a show_rpl_var.properties file:
----Start of file----
template=<your_wl_home>/common/templates/applications/medrec.jar
appname=MedRecEAR
domain_home=/some/target/dir/other/than/bea-user_projects/medrec
----End of file----
Do this with a a clean installation (one where no samples have been run) or delete/rename the $BEA_HOME/user_projects/applications/medrec directory. Once you run it, look in $BEA_HOME/user_projects to see a brand new applications/medrec dir containing everything that was under the apps dir of the medrec.jar (if you look inside it).
I believe this may be a bug, but I'm hoping that maybe there's something I should/could be doing in the wlst script prior to writting out the domain that just isn't documented anywhere (that I can find) to change what $APPLICATIONS_DIRECTORY$ defaults to.
I know I can probably explicitly set the SourcePath to the fully qualified dir but you shouldn't really have too.
Thanks again!
Ed
show_rpl_var.py (please note that the proper indentation is lost when posted so you'll have to manually add it back in):
----Start of Script----
from java import util
import wl
#=======================================================================================
# This Script loads a specified template that contains at least one app and then
# displays (prints) the "SourcePath" for the specified app.
# This script relies upon an acompaning properties file, named show_rpl_var.properties
# that is in the following format:
# template=./yourdomaintmpl.jar
# appname=your_app
# domain_home=/your_alt_domain_hom
# Usage:
# . $WL_HOME/server/bin/setWLSEnv.sh
# java org.python.util.jython domainBuilder.py
#=======================================================================================
def main():
buildProps = loadProperties()
buildDomain( buildProps )
#=======================================================================================
#=======================================================================================
def buildDomain( props ):
#// Read in the template
source = props[ "template" ]
print "Reading from template " + source
wl.readTemplate( source )
print "Template read"
#// Configure the default application.
wl.cd( "/AppDeployment/" + props[ "appname" ] )
print "App source path is: ", wl.get( "SourcePath" )
#// Write the Domain.
wl.setOption("OverwriteDomain", "true")
target = props[ "domain_home" ]
print "Writting domain to " + target
wl.writeDomain( target )
print "Domain written."
#=======================================================================================
#=======================================================================================
def loadProperties():
properties = {}
#load domain instance vars
prb = util.PropertyResourceBundle.getBundle( "show_rpl_var" )
prbKeys = prb.getKeys()
while( prbKeys.hasMoreElements() ):
key = prbKeys.nextElement()
properties[ key ] = prb.getString( key )
#prb = util.PropertyResourceBundle.getBundle( "pd_simple_seed_wl900" )
return properties
main()
-----End of Script-----

Similar Messages

  • Web Object Widget and replacing Variables in the URL

    I am using the new Web Object Widget in Captivate 7 and need some help with setting up the URL for the widget correctly.  If I hard-code a static web page address, the widget works fine.  The problems comes up when I need to slightly change the tail-end of the web address depending on who is taking the course.
    I need to dynamically append some variable information onto the web address that we will be calling such as:
    http://www.someplace.com/customizeforstudent.htm?Student_Name=$$studentName$$&Student_ID=$$studentId$$
    Is there any way to dynamically load the variable information into this widget when the student takes the course?
    I know that I was able to use the samples on captivatedev.com to do this web page variable replacement when I used JavaScript on a button so I know it can be done that way. 
    (see: http://captivatedev.com/2013/08/08/javascript-solution-launch-a-url-with-captivate-variabl es-as-parameters/ )
    The down-side of the captivatedev.com example is that it forces the web page to show up "outside" the course (either in a new window or it takes over the browser window the course is playing in.  I want to use the web object widget so I can stay "within" the normal flow of the course we are developing.
    I have been able to get the student name and student id from our LMS using JavaScript (thanks again to http://captivatedev.com).
    Whatever process we come up with needs to work not only with Flash, but also HTML5.
    Thank you for your time.
    Randy

    Hi BubbaRB and welcome to the forums.  I love it when people have great questions regarding integration.. and this is an area that Adobe Captivate needs to be better at!  It would be nice if the stock web page widget in Cp 7 had the ability to substitute Cp user variables in the URL to make for dynamic rendering of the web page, but unfortunately that's a limitation of the stock widget.
    The web page widget on CaptivateDev.com is capable of variable substitution in the URL.  You just need to enclose the variable with double dollar signs $$cpQuizInfoStudentID$$.
    http://captivatedev.com/2012/08/07/adobe-captivate-6-x-widget-web-page-widget/
    This widget works for SWF and HTML5 output for Cp 6 and 7 and there's a free trial available.

  • WLST Offline and MailSession

    I've tried to run the following WLST/Jython code:
    cd('/')
    lyra_name = 'LyraMailSession'
    lyra = create(lyra_name,'MailSession')
    lyra.setJNDIName('bogus.jndi.name.email')
    cd('MailSession/' + lyra_name)
    set('Properties','mail.smtp.host=email.tromskraft.lan)
    cd('/')
    assign('MailSession', lyra_name, 'Target', 'cgServer')
    This fails with the following error:
    Error: assign() failed.
    [java] File "/home/tronda/projects/tromskraft/customerportal/devenv/portal/build/filtered.py", line 137, in ?
    [java] File "initWls.py", line 62, in assign
    [java] com.bea.plateng.domain.script.jython.WLSTException: com.bea.plateng.domain.script.ScriptException: Unable to find the specified application or service
    The environment:
    WebLogic Platform 8.1.5
    Using WebLogic's built in version of ANT to run the following task:
    <java classname="com.bea.plateng.domain.script.jython.WLST_offline"
    dir="${basedir}" fork="true"
    failonerror="true"
    classpathref="wlst.classpath"
    >
    <arg file="${build.dir}/filtered.py" />
    </java>
    This also happens when running outside ANT. Any ideas?
    Trond Andersen, Invenia AS, http://www.invenia.no

    Hi Trond,
    I don't have a solution to the underlying problem, but I have a workaround that might be useful for you (if you've not created one already)
    After the writeDomain command has been run, call the following jython code:
    import org.dom4j as dom
    def mailSessionsFix( domainName, clusterName ):
         configLocation = domainName + "\config.xml"
         reader = dom.io.SAXReader()
         document = reader.read( configLocation )          
         root = document.getRootElement()
         mailSessions = root.elements("MailSession")
         for mailSession in mailSessions:
              mailSession.addAttribute("Targets",clusterName)
         out = io.FileWriter( configLocation );
         document.write( out );
         out.close()
    (The indentation will need fixing)
    Hope this helps,
    Adam

  • JMS queue assignment with WLST offline WLS 8.1

    Hi
    I would like to know how to assign a JMSQueue to JMSserver under WLST offline and WLS 8.1
    I've tried with assign(...) function or the setParent without success.
    As far as I understand, the JMSQueue is always created under a JMS server, once created there how can I assign it to another server??
    10x

    Hi
    I would like to know how to assign a JMSQueue to JMSserver under WLST offline and WLS 8.1
    I've tried with assign(...) function or the setParent without success.
    As far as I understand, the JMSQueue is always created under a JMS server, once created there how can I assign it to another server??
    10x

  • [WLST offline] runWLSToffline.sh deletes WL_HOME in startWeblogic.sh

    We have a small problem with runWLSToffline.sh. The program
    sets WL_HOME to an empty string in startWeblogic.sh.
    StartWeblogic.sh before runWLSToffline.sh is run:
    WL_HOME="/opt/bea/81sp2_hard/weblogic81"
    and after
    WL_HOME=""
    The work around is to make a copy of startWeblogic.sh before
    running runWLSToffline.sh, but is there a solution to the
    problem?
    We use Weblogic 8.1 sp2 on Solaris 9.
    Kind regards,
    Henrik

    Hi,
    I have wls 8.1 sp 4 running on my windows xp. I installed WLST-offline and jython (following the readme.txt that came in the same bundle as wlst). I also set the CLASSPATH as told, and it's now as follows:
    set CLASSPATH=C:\bea\weblogic81\server\lib;C:\bea\weblogic81\server\lib\weblogic.jar;C:\bea\weblogic81\common\lib\config.jar;C:\bea\weblogic81\common\lib\comdev.jar;C:\bea\weblogic81\common\lib\3rdparty.jar;C:\jython\jython.jar;
    All of the jar files are in right positions, but still when I run the command "runWLSToffline.cmd" (in $WL_HOME\common\bin) I get the following output:
    D:\bea\weblogic81\common\bin>java com.bea.plateng.domain.script.jython.WLST_offline
    Traceback (innermost last):
    File "initWls.py", line 7, in ?
    TypeError: cannot lazy load PyObject subclass
    What to do?
    please help, its very urget,
    Thanks so much in advance
    Regards,
    Bheemu

  • WLST offline Foreign JMS creation

    I am trying to setup a domain using the WLST, offline, and I need to create a couple of foreign JMS queues but I can not seem to find examples on creating them using the WLST. Is it even possible to do this? If so could someone please show me an example.
    Any help would be much appreciated,
    Thanks,
    PayniePayne

    The best way to learn unknown WLST commands is by recording a WLS console session (look for the "record" icon in the upper sniplet) . My recording shows the following commands (see http://e-docs.bea.com/wls/docs103/wlsmbeanref/mbeans/ForeignServerBean.html for complete reference):
    startEdit()
    cd('/')
    cmo.createJMSSystemResource('SystemModule-0')
    cd('/SystemResources/SystemModule-0')
    set('Targets',jarray.array(, ObjectName))
    cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0')
    cmo.createForeignServer('ForeignServer-0')
    cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/ForeignServers/ForeignServer-0')
    cmo.setDefaultTargetingEnabled(true)
    cmo.setConnectionURL('some.url')
    cmo.setInitialContextFactory('SomeInitialContextFactory')
    cmo.createForeignDestination('ForeignDestination-0')
    cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/ForeignServers/ForeignServer-0/ForeignDestinations/ForeignDestination-0')
    cmo.setLocalJNDIName('localQ')
    cmo.setRemoteJNDIName('remoteQ')
    activate()

  • Using a variable in a Powershell search and replace string

    Hi
    a couple of days ago I posted a question about doing a search and replace with wildcards
    Search and repalce with Widcards
    I got a swift and very helpful answer but now I need to build on it.
    In a text file I wanted to replace all the text between two defined words.  the script I got was this
    $text = 'Some Server this bit of text varies Language stuff'
    $text -replace '(.*Server) .+? (Language.*)','$1 it will always say this $2'
    It works great but now I want to replace "it will always say this" with a variable and I can't figure out the correct grammar to make this happen.
    Can anyone help??
    Thanks
    Alex

    Here's one way:
    $replace = 'it will aways say this'if ( $text -match '(.*Server) .+? (Language.*)' )
    { "{0} $Replace {1}" -f $matches[1,2] }
    else { $text }
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • WorkFlow Issues: Appending (not replace) Attendee Field in Calendar List and Email Variables (including .ICS file link)

    Kind of new to attempting any custom development in SharePoint.  Working with 2013 and have the 2013 Workflow Farm setup/working.  I am trying to have a calendar that users can register to appointments via custom list.  I
    have the list that pulls the title into its  own "Event" field as a lookup.  Also have a workflow on the calendar that adds the current user as an attendee and made that field "not required".  I'm trying to accomplish this:
    1) Have the Custom List update the Calendar list attendee field with the username. Currently it wipes out what is there and replaces with the "Created By" name. Tried to set a variable that would put the current attendees in a string
    and just add the current user, then use that variable to update the attendee field.  No luck.  Ultimately if I can understand this enough and get fancy enough, I'd setup a workflow  that can have someone delete their own registration item in
    the custom list and remove only their own name from Attendees...
    2)  Have a workflow kick off an email that sends the registrant the calendar details. Have tried to pipe in variables to get the ICS file (some variation of this )
     If I put the List ID in brackets I get an error about having that and variables in the same code for an email workflow.  In any event I can't really get the email workflow to give any kind of nice piped in values the best looked like this and had
    the wrong date: You registered for  {"results":[{"Id":22,"Value":"Test Event 8"}]} on 1/1/0001 12:00:00 AM

    Hi Jason,
    seems your requirement a bit complex, we forum team may have limited resource regarding this issue.
    you may consider to use infopath for example from this 3rd party article:
    http://www.bizsupportonline.net/infopath2007/programmatically-add-item-sharepoint-calendar-infopath.htm
    or for general example:
    http://office.microsoft.com/en-001/infopath-help/customize-a-sharepoint-list-form-HA101821257.aspx
    the article is to add an item to your calendar list, so then you may need to do wipe or other procedures, by infopath you may add the data as
    you need.
    if should infopath feature may not be possible to use in your environment, i may need to suggest you to open an advisory case to us, by contacting our representative,
    https://support.microsoft.com/
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Xml search and replace for 'Session Variables' in column title view

    Hi Experts,
    I have around 10 reports where measure column titles are displayed based the session variable.
    Below is the syntax I have used in the column title
    @{biServer.variables['NQ_SESSION.VariableName']}
    Now I would like to replace the above syntax with some static text. To do this, I am trying to use the xml search and replace feature in the catalog manager.
    For some reason, catalog manager is unable to find the syntax in the xml file. I have tried using escape character also for the apostrophe by using &apos, but no luck.
    Any pointers on how to replace the text?
    Thanks

    Using Analysis get the xml conversion for @{biServer.variables['NQ_SESSION.VariableName']} from Advanced tab's xml code
    use this code to find in catalog manager, if you able to find then go for search and replace option.
    I think this should work for you.

  • How to create users and groups using WLST Offline with Weblogic 8.1.4

    How to create users and groups using WLST Offline with Weblogic 8.1.4?
    Any ideas?

    Hi this is how i created a user using WLST Offline?
    cd('/Security/' + domainName)
    # Delete the default user name weblogic
    # incase you want to remove the defualt user weblogic
    delete('weblogic','User')
    # Creating a new user defined
    create(userName, 'User')
    # Setting the password of the user you created.
    cd ('/Security/' + domainName + '/User/' + userName)
    cmo.setPassword(password)
    Regards
    Makenzo

  • Help with removing a variable number using "find and replace"

    Hey, I have to remove a variable number from a large number of documents.
    How would I do this using "find and replace"
    <text><![CDATA[Coloured 250]]></text>
    250 is an example of the variable number that I will need to remove so it looks like this:
    <text><![CDATA[Coloured]]></text>
    Note: the text "coloured" is subject to change also.
    Thanks

    That's a possibilitly I'll explore.  Thanks for the alternate perspective!
    (5 minutes later)
    Oh well, it was a good thought.
    Unfortunately each line of raw original text may contain from 1 to 4 lines of final text.  In other words there is no consistency in the number of backslashes (hard returns) in each line of original text, and thus, when backslashes are converted to commas, no consistency in the number of data elements in each data set. 
    Sadly PS variables will not handle finding a source text line that does not have data for 4 variables.  So I either have to go back and add enough commas on each short line to make four individual data elements for each data set... or I simply deal with the hard returns within Photoshop.
    I think I've reached the limit of automation on this process.

  • Find and Replace with User Defined Variable

    I am in the process of converting some legacy help content to RoboHelp HTML 9 in order to give it some more features and customization for our clients. I have been taking advantage of User Defined Variables in order to customize the content. Up to this point I have been manually going through each topic and replacing each instance of a word ("statements" for example) with a user defined variable saying the same thing but with the possibility of being changed later should the customer want to. Though we only have about 200 topics, this is still relatively time-consuming and I would like to automate this as much as possible.
    Is there any way to find and replace content with a User Defined Variable?

    Hi there
    If you open the Script Explorer pod I believe one of the sample scripts is a "UDV Converter" script. Perhaps you could give that a try.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Find and replace global variables

    Hi there,
    I've ran into a mess with my global variables. While I was trying to rename one of the globals, all instances in hundreds of subvis turned corrupt. The icon of the global variable turned black and the wires starting at the variable became broken. The amazing thing is that the black icons seem still to be linked to the correct global variable. If I leave the mouse cursor on the icon, the correct file path appears in the context help window. If I double click on the corrupt icon, the correct vi is opened. I tried "Save as" and "Rename" with various options. LabVIEW seems to browse through all affected vis but the icons remain broken. My last hope was to run the "Find and replace" tool (Ctrl + F), but it doesn't work for global variables for some unknown reason, unfortunately. Compare
    http://forums.ni.com/ni/board/message?board.id=170&message.id=438450&query.id=2151294
    Is anybody out there who has a useful hint?
    Peter

    stoeckel wrote:
    Hi there,
    thank you all for your contributions. We were able to solve the problem in the meanwhile. Why did nobody point us to the fact that the icons of global variables turn black if the name of the control on the panel of the variable does not match the selected name inside the icon?
    The LabVIEW compiler would have told you that right away. If you click the broken run arrow on the situation you will get the message:
    An item with the specified name could not be found. Select a different item from the list.
    Seems pretty straightforward to me. But then, perhaps it's because I've been using LabVIEW for some time.
    If somebody just quietly mentions the existence of "global variables" he or she will usually be soused with flout and bashed by the proven active veterans. But why's that? Global variables can provide an easy way to communicate a "stop" information throughout all running vis. As long as there is just one writer and many readers, there is no danger that it comes to "race conditions".  
    If global variables are really so nasty as is often said, why does National Instruments still provide them within LabVIEW??
    I don't want to get into yet another global variable debate here. The only comment regarding global variables made in this thread was a tongue-in-cheek comment I made. I was not dissing global variable. In fact, I use them quite often. Global variables, like every other programming construct ever invented have their use. The main reason you will see the so called "proven active veterans" go crazy over global variables is that they constantly see them being abused, causing race conditions, and then have to listen to newbies complain that their program doesn't work and LabVIEW sucks, when it's really their programming skills that's the real problem. But that's just my opinion.

  • Find and replace help needed, multiple variables

    Hi everyone,
    Im trying to find all urls in my code that start in a particular way but have a number variable at the end, see examples below
    <a href="/example/examplefolder/enquiry.asp?pid=123">
    <a href="/example/examplefolder/enquiry.asp?pid=485">
    <a href="/example/examplefolder/enquiry.asp?pid=284">
    and replace them with one url, see example below
    <a href="/example/examplefolder/default.asp">
    How can I use Dreamweaver find and replace to achieve this across my whole website?
    So far I only know how to find one thing and replace with another, rather than finding variables and replacing them with one thing.
    Thanks for your help with this!

    In the Find field of the Find and Replace dialog box, enter this:
    (href\s*=\s*\"\/example\/examplefolder\/enquiry\.asp)\?pid=\d+(\")
    In the Replace field, enter this:
    $1$2
    Select the "Use regular expression" checkbox.
    Explanation:
    The two sets of parentheses are capturing groups, which capture the actual values as $1 and $2.
    The \s* matches zero or more spaces.
    \" matches a double quote.
    \/ matches a forward slash.
    \? matches a question mark
    \d+ matches one or more numbers.
    I have written a two-part tutorial on using regular expressions, which can be found here: http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions_pt1.html.
    Message was edited by: David_Powers (adding explanation of double quote).

  • Difference between Replacement with a query and Replacement from Variable

    Hi Gurus
    Would explain the difference between the Replacement Path: Replacement with a query and Replacement Path: Replacement from Variable with scenarios.
    Thanks in advance,
    Aravind.S

    Hi,
    If you are using Replacement with query, the given query output will be used as input your variable. For example if you want to display the product details, which can be find our from a query.
    And Replacement with Variable will be used  when you want to give the same input  in two different fields. for example if you want to see the records from sending location and not the records from recived location at the same time. Here once you give the sending location id, it will be taken as the same input for received location.
    Regards,
    Vishnu

Maybe you are looking for

  • Pls suggest  the BPM  design .

    Hello, We are in PI7.1. The requirement is 1:N mapping the file to IDoc ACC_DOCUMENT01. Before calling the Idoc we need to check the Duplicate Invoice BAPI, if the bapi return error code "11" calling Idoc should be skipped. Could you suggest the desi

  • What is up with the new "eye" icon in itunes 7, "quickly browes library ???

    i have clicked on this "eye" icon (bottom right corner) and it does nothing...what is it supossed to do and how do you use it ?????...also want to add my sadness about the lack of function this 7 version has over previous (visualizer, equalizer...i'm

  • MIGO against Subcontracting PO

    Hello Experts, We are doing the MIGO against subcontracting PO/SA .When we refer the reference docuemnt as PO/SA system will propose the item details from BOM against 543 movement type and actual GRN quantity which is entered by User. Where do we mak

  • Install windows 7 boot camp

    Hi! After having   installed Lion I'm trying to install Windows 7 thru  boot camp. But when I insert the instlation disk a black screen appears with: 1. 2. Select CD- Rom Boot Type: _ Need help!

  • Why can't I view some of the photos in iphoto

    I used to be able to see all my photos in iphoto. now a lot of them are just a gray square. Why can't I see them? Any help will be greatly appreciated.