Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I typically don't do this using xmlaccess (couldn't tell you how). I redeploy the portlet application (war or ear depending on how you package it) as I would any application in WAS. Either through the admin console, or using wsadmin. It shouldn't be a problem for you to do it that way since portlet registrations are maintained over redeploys. Here is a sample jython script for deploying an app using wsadmin. It works both standalone and clustered (connect to the primary node).</p> <pre><code>import sys import time def wsadminToList(inStr): outList=[] if (len(inStr)&gt;0 and inStr[0]=='[' and inStr[-1]==']'): tmpList = inStr[1:-1].split() #splits space-separated lists, else: tmpList = inStr.split("\n") #splits for Windows or Linux for item in tmpList: item = item.rstrip(); #removes any Windows "\r" if (len(item)&gt;0): outList.append(item) return outList #endDef def installPortalApp(earFileName, appName, cellName, clusterName, installOptions): #-------------------------------------------------------------- # set up globals #-------------------------------------------------------------- global AdminApp global AdminControl global AdminConfig global Help installOptions.append('-appname') installOptions.append(appName) # Should we install on a cluster? if len(clusterName) != 0: appServer = 'WebSphere:cell=' + cellName + ',cluster=' + clusterName mapModuleOptions = [[ '.*', '.*', appServer ]] # Append additional options installOptions.append('-cluster') installOptions.append(clusterName) AdminApp.install(earFileName, installOptions) AdminConfig.save( ) count = 0 # This is probably not necessary while not AdminApp.isAppReady(appName) and count &lt; 10: count = count + 1 print 'Waiting for app to be ready ' + count + ' of 10' time.sleep(10) #endWhile clusterId = AdminConfig.getid('/ServerCluster:' + clusterName + '/' ) print 'clusterId' + clusterId clusterMembers = wsadminToList(AdminConfig.list('ClusterMember', clusterId)) for member in clusterMembers: print 'startApplication on member ' + str(member) currentServer = AdminConfig.showAttribute(member, 'memberName') print 'currentServer ' + currentServer currentNodeName = AdminConfig.showAttribute(member, 'nodeName') print 'currentNodeName ' + currentNodeName query = 'cell=' + cellName + ',node=' + currentNodeName + ',type=ApplicationManager,process=' + currentServer + ',*' print 'query ' + query appMgr = AdminControl.queryNames(query ) print appMgr Sync1 = AdminControl.completeObjectName('type=NodeSync,node=' + currentNodeName + ',*') print 'Sync1 ' + Sync1 AdminControl.invoke(Sync1, 'sync') print 'Node synchronized. Waiting a short while for binary expansion to finish' time.sleep(5) print 'Starting application' AdminControl.invoke(appMgr, "startApplication", appName ) #endFor else: appMgr = AdminControl.queryNames("type=ApplicationManager,*" ) AdminApp.install(earFileName, installOptions) AdminConfig.save( ) AdminControl.invoke(appMgr, "startApplication", appName ) #endIf #endDef #if (len(sys.argv) != 4 and len(sys.argv) != 5): # print len(sys.argv) # print "install_application_ear.py: this script requires the following parameters: ear file name, application name, cell name, install options and cluster name (optional)" # sys.exit(1) #endIf earFileName = sys.argv[0] print 'earFileName' + earFileName appName = sys.argv[1] cellName = sys.argv[2] installOptions = eval(sys.argv[3]) clusterName = "" if len(sys.argv) == 5: clusterName = sys.argv[4] installPortalApp(earFileName, appName, cellName, clusterName, installOptions) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload